Fragment onActivityResult - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment onActivityResult method.

This code example shows how to use the following methods:getActivity, onActivityResult
     * information when a session is opened. If this method is overridden in subclasses, 
     * be sure to call {@code super.onActivityResult(...)} first. 
     */ 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) { 
        super.onActivityResult(requestCode, resultCode, data); 
        sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data); 
    } 
 
    @Override 
    public void onDestroy() { 
        super.onDestroy(); 
        sessionTracker.stopTracking(); 
    } 
 
    /** 
     * Use the supplied Session object instead of the active Session. 
     * 
     * @param newSession the Session object to use 
     */ 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getActivity, onActivityResult
     * information when a session is opened. If this method is overridden in subclasses, 
     * be sure to call {@code super.onActivityResult(...)} first. 
     */ 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) { 
        super.onActivityResult(requestCode, resultCode, data); 
        sessionTracker.getSession().onActivityResult(this.getActivity(), requestCode, resultCode, data); 
    } 
 
    @Override 
    public void onDestroy() { 
        super.onDestroy(); 
        sessionTracker.stopTracking(); 
    } 
 
    /** 
     * Use the supplied Session object instead of the active Session. 
     * 
     * @param newSession the Session object to use 
     */ 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityResult
   	getActivity().registerReceiver(_receiver, filter);
  } 
     
  @Override 
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
  	super.onActivityResult(requestCode, resultCode, data);
 
		Log.d(TAG, "FragmentBase: requestCode == " + requestCode);
		Log.d(TAG, "FragmentBase: resultCode == " + resultCode);
         
    switch(requestCode) {
    	case(2): 
        if (resultCode == Activity.RESULT_OK) { 
	        Bundle extras = data.getExtras();
	        if (extras != null) {
	        	String field = extras.getString("FIELD");
	        	if (field != null) {
							Log.d(TAG, "FragmentBase: extras field == " + field);	
	        		if(field.equals("weapon_id")){
								updateCharacterWeapon(field);	
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getActivity, onActivityResult
	 * @return String containing the path of the selected image 
	 */ 
	private String parseImage(Intent intent){
		Uri data = intent.getData();
		 
		Cursor cursor = getActivity().managedQuery(data, 
				new String[]{MediaStore.Images.Media.DATA}, null, null, null);
		 
		int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        cursor.moveToFirst();
        String image = cursor.getString(column_index);
        cursor.close();
        return image;
	} 
	 
	@Override 
	public void onActivityResult(int requestCode, 
			int resultCode, Intent data) {
		if (requestCode == 0 && resultCode == Activity.RESULT_OK){
			String path = parseImage(data);

4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityResult
     	getActivity().registerReceiver(_receiver, filter);
    } 
     
    @Override 
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
 
        Log.d(TAG, "requestCode == " + requestCode);
        Log.d(TAG, "resultCode == " + resultCode);
         
        switch(requestCode) {
        case(2): 
        	if (resultCode == Activity.RESULT_OK) { 
	        	Bundle extras = data.getExtras();
	        	if (extras != null) {
	        	 
	        	String field = extras.getString("FIELD");
	        	if (field != null) {
	        		updateCharacter(field);
	        	} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityResult
        getActivity().runOnUiThread(runnable);
    } 
 
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
 
        if (resultCode == Activity.RESULT_OK) {
 
            Uri mediaLocation = null;
            if (data != null) {
                mediaLocation = data.getData();
                new UpdateMedia().execute(mediaLocation);
            } 
        } 
    } 
 
    public class UpdateMedia extends AsyncTask<Uri, Object, File> {
 
        ProgressDialog dialog;
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityResult
        Log.d(TAG, "onActivityCreated: fragment activity created ");
    } 
     
    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Log.d(TAG, new StringBuilder("onActivityResult ").
                append(" request=").append(requestCode).
                append(" result=").append(resultCode).
                append(" intent=[").append(data).append("]").
                toString());
    } 
 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityResult
	    //... 
	} 
 
	@Override 
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
	} 
	 
	@Override 
	public void onClick(View v) {
		if(v.getId() == R.id.left_btn_i_discuss) {
			intent = new Intent(context, MyDiscussActivity.class);
			startActivity(intent);
		} 
		 
		if(v.getId() == R.id.left_btn_discuss_i) {
			intent = new Intent(context, DiscussForMeActivity.class);
			startActivity(intent);
		} 
		if(v.getId() == R.id.left_tv_personalsetting) {
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onActivityResult
	@Override 
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		LogUtils.lifecycle(LOG_TAG, "onActivityResult called with requestCode="
				+ requestCode + " resultCode=" + resultCode + " data=" + data);
 
		super.onActivityResult(requestCode, resultCode, data);
	} 
 
	@Override 
	public void onSaveInstanceState(Bundle outState) {
		LogUtils.lifecycle(LOG_TAG, "onSaveInstanceState called with outState="
				+ outState);
		super.onSaveInstanceState(outState);
	} 
 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Fragment onActivityResult Questions & Answers:

onActivityResult Method Overview
Receive the result from a previous call to startActivityForResult(Intent, int).
See Code Examples for other Android Fragment Methods: