Code example for ListFragment

Methods: getActivity, startActivityForResult

	private void editAlarm(int position) {
		Log.d(TAG, String.format("editAlarm(%d)", position));
		AlarmModel alarm = null;
		if (position >= 0)
			alarm = mAlarms.get(position);
		Intent intent = new Intent(getActivity(), EditAlarmActivity.class);
		intent.putExtra("alarm", alarm);
		intent.putExtra("position", position);
		startActivityForResult(intent, EDIT_ALARM_REQUEST);
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		switch (requestCode) {
			if (data != null) {
				Bundle bundle = data.getExtras();
				AlarmModel alarm = bundle.getParcelable("alarm");
				int position = bundle.getInt("position");
				if (position >= 0)
Connect your IDE to all the code out there  Get Codota for Java