Android Open Source - SharedUrlList Share U R L Fragment






From Project

Back to project page SharedUrlList.

License

The source code is released under:

GNU General Public License

If you think the Android project SharedUrlList listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.laxu.apps.sharedurllist;
//www.ja  v a  2s  .  com
import android.app.NotificationManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;

public class ShareURLFragment extends FragmentActivity {
  NotificationManager notificationManager;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Intent intent = this.getIntent();
    String action = intent.getAction();
    String type = intent.getType();
    if(Intent.ACTION_SEND.equals(action) && type != null && type.equals("text/plain")){
      String url = intent.getStringExtra(Intent.EXTRA_TEXT);
      Util.createNotification(this, "adding URL to List ...", url, android.R.drawable.ic_menu_upload, true);  //TODO: use own icon or local copy, as android guide says not to use android.drawable
      addUrl(url);
      finish();
    }else{
      Log.e("ShareURLFragment", "wrong call to ShareURLFragment");
      finish();
    }
  }
  public void addUrl(String url){
    (new addUrlTask(this, url)).execute();
  }
  public void successMessage(String url){
    Util.createNotification(this, "Added URL", url, android.R.drawable.ic_menu_add, false); //TODO: use own icon or local copy, as android guide says not to use android.drawable
  }
  public void errorMessage(String url, String errormessage){
    Util.createNotification(this, "Error adding URL", errormessage, android.R.drawable.ic_menu_add, false); //TODO: use own icon or local copy, as android guide says not to use android.drawable
  }

}




Java Source Code List

de.laxu.apps.sharedurllist.AddUrlDialog.java
de.laxu.apps.sharedurllist.DeleteUrlTask.java
de.laxu.apps.sharedurllist.EnterPasswordFragment.java
de.laxu.apps.sharedurllist.LoadUrlListTask.java
de.laxu.apps.sharedurllist.MainActivity.java
de.laxu.apps.sharedurllist.RequestTokenTask.java
de.laxu.apps.sharedurllist.SettingsActivity.java
de.laxu.apps.sharedurllist.ShareURLFragment.java
de.laxu.apps.sharedurllist.UrlListEntry.java
de.laxu.apps.sharedurllist.Util.java
de.laxu.apps.sharedurllist.listeners.OnAddUrlMenuItemClickListener.java
de.laxu.apps.sharedurllist.listeners.OnCopyMenuItemClickListener.java
de.laxu.apps.sharedurllist.listeners.OnDeleteMenuItemClickListener.java
de.laxu.apps.sharedurllist.listeners.OnRefreshMenuItemClickListener.java
de.laxu.apps.sharedurllist.listeners.OnRequestTokenMenuItemClickListener.java
de.laxu.apps.sharedurllist.listeners.OnSettingsButtonClickListener.java
de.laxu.apps.sharedurllist.listeners.OnSettingsMenuItemClickListener.java
de.laxu.apps.sharedurllist.addUrlTask.java