List of usage examples for android.content Intent ACTION_EDIT
String ACTION_EDIT
To view the source code for android.content Intent ACTION_EDIT.
Click Source Link
From source file:Main.java
public static Intent createNewEventIntent() { Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType(INTENT_TYPE_EVENT); return intent; }
From source file:Main.java
public static Intent newCalendarIntent(Context context, Date startDate, String title, String location, String note) {// ww w . j av a2 s .co m Calendar cal = Calendar.getInstance(); cal.setTime(startDate); Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra("beginTime", cal.getTimeInMillis()); intent.putExtra("endTime", cal.getTimeInMillis() + 60 * 60 * 1000); intent.putExtra("allDay", true); //intent.putExtra("rrule", "FREQ=WEEKLY;COUNT="+numWeeks); //intent.putExtra("rrule", "FREQ=YEARLY"); intent.putExtra("title", title); intent.putExtra("eventLocation", location); intent.putExtra("description", note); //intent.putExtra(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE); //intent.putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY); return intent; }
From source file:Main.java
public static Intent prepareEditContactIntent(int id) { Intent intent = new Intent(Intent.ACTION_EDIT, Contacts.CONTENT_URI); Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, id); intent.setData(contactUri);/*from w ww.ja v a 2 s . c o m*/ return intent; }
From source file:Main.java
public static void addToCalendar(Activity context, Long beginTime, String title) { ContentResolver cr = context.getContentResolver(); Uri.Builder builder = Uri.parse("content://com.android.calendar/instances/when").buildUpon(); Long time = new Date(beginTime).getTime(); ContentUris.appendId(builder, time - 10 * 60 * 1000); ContentUris.appendId(builder, time + 10 * 60 * 1000); String[] projection = new String[] { "title", "begin" }; Cursor cursor = cr.query(builder.build(), projection, null, null, null); boolean exists = false; if (cursor != null) { while (cursor.moveToNext()) { if ((time == cursor.getLong(1)) && title.equals(cursor.getString(0))) { exists = true;//ww w.j a v a 2 s. c o m } } } if (!exists) { Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra("beginTime", time); intent.putExtra("allDay", false); intent.putExtra("endTime", time + 60 * 60 * 1000); intent.putExtra("title", title); context.startActivity(intent); } else { Toast.makeText(context, "Event already exist!", Toast.LENGTH_LONG).show(); } }
From source file:fr.smile.cordova.calendar.CalendarPlugin.java
@Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { try {/* ww w . java 2s . c o m*/ if (ACTION_ADD_TO_CALENDAR.equals(action)) { callback = callbackContext; Intent calIntent = new Intent(Intent.ACTION_EDIT).setType("vnd.android.cursor.item/event") .putExtra("title", args.getString(0)).putExtra("eventLocation", args.getString(1)) .putExtra("description", args.getString(2)).putExtra("beginTime", args.getLong(3)) .putExtra("endTime", args.getLong(4)).putExtra("allDay", args.getBoolean(5)); this.cordova.startActivityForResult(this, calIntent, RESULT_CODE_CREATE); return true; } } catch (Exception e) { System.err.println("Exception: " + e.getMessage()); callbackContext.error("Exception: " + e.getMessage()); return false; } return false; }
From source file:com.commonsware.android.tte.DocumentStorageService.java
public static void saveDocument(Context ctxt, Uri document, String text, boolean isClosing) { Intent i = new Intent(ctxt, DocumentStorageService.class).setAction(Intent.ACTION_EDIT).setData(document) .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION) .putExtra(Intent.EXTRA_TEXT, text).putExtra(EXTRA_CLOSING, isClosing); ctxt.startService(i);/*from w w w . j a v a 2 s . c o m*/ }
From source file:com.sencha.plugins.calendar.Calendar.java
@Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { try {/*from w ww . j a va2 s. c o m*/ if (ACTION_ADD_CALENDAR_ENTRY.equals(action)) { JSONObject arg_object = args.getJSONObject(0); Intent calIntent = new Intent(Intent.ACTION_EDIT).setType("vnd.android.cursor.item/event") .putExtra("beginTime", arg_object.getLong("startTimeMillis")) .putExtra("endTime", arg_object.getLong("endTimeMillis")) .putExtra("title", arg_object.getString("title")) .putExtra("description", arg_object.getString("description")) .putExtra("eventLocation", arg_object.getString("eventLocation")); this.cordova.getActivity().startActivity(calIntent); callbackContext.success(); return true; } callbackContext.error("Invalid action"); return false; } catch (Exception e) { System.err.println("Exception: " + e.getMessage()); callbackContext.error(e.getMessage()); return false; } }
From source file:com.github.baoti.pioneer.ui.news.NewsActivity.java
public static Intent actionEdit(Context context) { return withAction(context, Intent.ACTION_EDIT).putExtra(EXTRA_EDITABLE, true); }
From source file:com.github.baoti.pioneer.ui.news.NewsActivity.java
public static Intent actionEdit(Context context, News news) { return withAction(context, Intent.ACTION_EDIT).putExtra(EXTRA_EDITABLE, true).putExtra(EXTRA_NEWS, news); }
From source file:org.inftel.ssa.mobile.ui.fragments.ProjectEditFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mActivity = getActivity();/*from ww w . j a v a2s .com*/ mIntent = mActivity.getIntent(); mAction = mIntent.getAction(); if (Intent.ACTION_EDIT.equals(mAction)) { mState = STATE_EDIT; getLoaderManager().initLoader(0, null, this); } else if (Intent.ACTION_INSERT.equals(mAction)) { mState = STATE_INSERT; // New item (set default values) } setHasOptionsMenu(true); }