Пример #1
0
 @Override
 protected void onResume() {
   super.onResume();
   StorageUtils.checkStorageAvailability(this);
   Intent intent = getIntent();
   if (intent.getAction() != null && intent.getAction().equals(Intent.ACTION_SEND)) {
     if (AppConfig.DEBUG) Log.d(TAG, "Was started with ACTION_SEND intent");
     String text = intent.getStringExtra(Intent.EXTRA_TEXT);
     if (text != null) {
       etxtFeedurl.setText(text);
     } else {
       if (AppConfig.DEBUG) Log.d(TAG, "No text was sent");
     }
   }
 }
Пример #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    setTheme(PodcastApp.getThemeResourceId());
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    StorageUtils.checkStorageAvailability(this);
    setContentView(R.layout.addfeed);

    requester = DownloadRequester.getInstance();
    progDialog = new ProgressDialog(this);

    etxtFeedurl = (EditText) findViewById(R.id.etxtFeedurl);
    butBrowseMiroGuide = (Button) findViewById(R.id.butBrowseMiroguide);
    butOpmlImport = (Button) findViewById(R.id.butOpmlImport);
    butGreaderImport = (Button) findViewById(R.id.butGreaderImport);
    butConfirm = (Button) findViewById(R.id.butConfirm);
    butCancel = (Button) findViewById(R.id.butCancel);

    butBrowseMiroGuide.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            startActivity(new Intent(AddFeedActivity.this, MiroGuideMainActivity.class));
          }
        });

    butOpmlImport.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            startActivity(new Intent(AddFeedActivity.this, OpmlImportFromPathActivity.class));
          }
        });

    butGreaderImport.setOnClickListener(
        new OnClickListener() {

          @Override
          public void onClick(View v) {
            startActivity(new Intent(AddFeedActivity.this, GoogleReaderImportActivity.class));
          }
        });

    butConfirm.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            addNewFeed();
          }
        });

    butCancel.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            setResult(RESULT_CANCELED);
            finish();
          }
        });
  }