Beispiel #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.singleevent);
    BugSenseHandler.setup(this, "ed5c1682");
    String CookieHTTPString = getIntent().getExtras().getString("Cookie");
    URLStringtoCall = getIntent().getExtras().getString("URL");
    PREPCall = getIntent().getExtras().getBoolean("PREPLink");
    URL URLtoCall;
    Spinner optionSpinner = (Spinner) findViewById(R.id.singleevent_spinner);
    ArrayAdapter<String> spinnerAdapter =
        new ArrayAdapter<String>(
            this,
            android.R.layout.simple_spinner_item,
            getResources().getStringArray(R.array.singleevent_options));
    optionSpinner.setAdapter(spinnerAdapter);
    optionSpinner.setOnItemSelectedListener(new OnItemSelectedListener());

    try {
      URLtoCall = new URL(URLStringtoCall);
      localCookieManager = new CookieManager();
      localCookieManager.generateManagerfromHTTPString(URLtoCall.getHost(), CookieHTTPString);
      callResultBrowser = new SimpleSecureBrowser(this);
      RequestObject thisRequest =
          new RequestObject(URLStringtoCall, localCookieManager, RequestObject.METHOD_GET, "");

      callResultBrowser.execute(thisRequest);
    } catch (MalformedURLException e) {
      Log.e(LOG_TAG, e.getMessage());
    }
  }
Beispiel #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState, true, 3);
    setContentView(R.layout.exams);

    // Webhandling Start
    String CookieHTTPString = getIntent().getExtras().getString("Cookie");
    URLStringtoCall = getIntent().getExtras().getString("URL");
    UserName = getIntent().getExtras().getString("UserName");
    URL URLtoCall;
    if (!restoreResultBrowser()) {
      try {
        URLtoCall = new URL(URLStringtoCall);
        CookieManager localCookieManager = new CookieManager();
        localCookieManager.generateManagerfromHTTPString(URLtoCall.getHost(), CookieHTTPString);
        callResultBrowser = new SimpleSecureBrowser(this);
        RequestObject thisRequest =
            new RequestObject(URLStringtoCall, localCookieManager, RequestObject.METHOD_GET, "");

        callResultBrowser.execute(thisRequest);
      } catch (MalformedURLException e) {
        Log.e(LOG_TAG, e.getMessage());
      }
    }
    // Webhandling End
  }