コード例 #1
0
ファイル: SingleEvent.java プロジェクト: ploebb/TuCanMobile
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    if (mode == 1 && thereAreFiles) {
      if (!materialLink.get(position).equals("")) {
        String url = TucanMobile.TUCAN_PROT + TucanMobile.TUCAN_HOST + materialLink.get(position);
        Log.i(LOG_TAG, url);
        Uri mUri = Uri.parse(url);
        Intent DownloadFile = new Intent(Intent.ACTION_VIEW, mUri);

        startActivity(DownloadFile);
      }
    }
  }
コード例 #2
0
ファイル: Exams.java プロジェクト: pradeepb6/TuCanMobile
  protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);

    if (scrape != null && mode == 0) {
      SimpleSecureBrowser callOverviewBrowser = new SimpleSecureBrowser(this);
      RequestObject thisRequest;
      switch (position) {
        case 0:
          mode = 10;
          thisRequest =
              new RequestObject(
                  TucanMobile.TUCAN_PROT + TucanMobile.TUCAN_HOST + scrape.examLinks.get(0),
                  scrape.getCookieManager(),
                  RequestObject.METHOD_GET,
                  "");
          callOverviewBrowser.execute(thisRequest);
          break;
        case 1:
          mode = 1;
          Log.i(LOG_TAG, "Exam Names hat: " + scrape.examNames.size() + " Elemente");

          thisRequest =
              new RequestObject(
                  TucanMobile.TUCAN_PROT + TucanMobile.TUCAN_HOST + scrape.examLinks.get(1),
                  scrape.getCookieManager(),
                  RequestObject.METHOD_GET,
                  "");
          callOverviewBrowser.execute(thisRequest);
          Log.i(LOG_TAG, "Exam Names hat: " + scrape.examNames.size() + " Elemente");
          break;
        case 2:
          mode = 2;
          Log.i(LOG_TAG, "Exam Names hat: " + scrape.examNames.size() + " Elemente");
          thisRequest =
              new RequestObject(
                  TucanMobile.TUCAN_PROT + TucanMobile.TUCAN_HOST + scrape.examLinks.get(2),
                  scrape.getCookieManager(),
                  RequestObject.METHOD_GET,
                  "");
          callOverviewBrowser.execute(thisRequest);
          Log.i(LOG_TAG, "Exam Names hat: " + scrape.examNames.size() + " Elemente");
          break;
        case 3:
          mode = 3;
          thisRequest =
              new RequestObject(
                  TucanMobile.TUCAN_PROT + TucanMobile.TUCAN_HOST + scrape.examLinks.get(3),
                  scrape.getCookieManager(),
                  RequestObject.METHOD_GET,
                  "");
          callOverviewBrowser.execute(thisRequest);
          break;
        case 4:
          Intent callRegisterExams = new Intent(this, RegisterExams.class);
          callRegisterExams.putExtra("URL", scrape.examLinks.get(4));
          callRegisterExams.putExtra(
              "Cookie", scrape.getCookieManager().getCookieHTTPString(TucanMobile.TUCAN_HOST));
          callRegisterExams.putExtra("UserName", UserName);
          startActivity(callRegisterExams);
          // TODO: Call RegisterEvents
        default:
          break;
      }
    }
  }