<!-- language: none -->
04-23 11:47:01.904: E/AndroidRuntime(12396):
java.lang.RuntimeException: Unable to resume activity {com.t4t.sp/com.t4t.sp.SignUpActivity}:
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=111, result=-1, data=Intent { act=content://media/external/images/media/3809 (has extras) }} to activity {com.t4t.sp/com.t4t.sp.SignUpActivity}:
java.lang.NullPointerException
I am not able to find out why the activity is not able to produce the result,what I want is I am launching an edit intent and after the editing I want to supply the uri to my onactivity result.
Edited :
Here is my code of on create method
`protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGESS);
setContentView(R.layout.activity_sign_up);
mUsername=(EditText)findViewById(R.id.usernameField);
mPassword=(EditText)findViewById(R.id.passwordField);
mImage=(ImageView) findViewById(R.id.imageView1);
medit=(Button)findViewById(R.id.edit);
medit.setVisibility(View.GONE);
mImage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v)
{
Intent choosePhotoIntent=new Intent(Intent.ACTION_GET_CONTENT); choosePhotoIntent.setType("image/*");
choosePhotoIntent.putExtra("crop", "true");
choosePhotoIntent.putExtra("outputX", 128);
choosePhotoIntent.putExtra("outputY", 128);
choosePhotoIntent.putExtra("aspectX", 1);
choosePhotoIntent.putExtra("aspectY", 1);
choosePhotoIntent.putExtra("scale", true);
startActivityForResult(choosePhotoIntent, PICK_PHOTO_REQUEST);
}
});
`
here is my onactivity for result code where i am getting a null value for data as when i am trying to fetch the url its saying null pointer over there :
@SuppressLint("NewApi")
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.e("resultcode",Integer.toString(resultCode));
Log.e("requestcode",Integer.toString(requestCode));
String fileType = null;
if(resultCode==RESULT_OK){
if(requestCode==PICK_PHOTO_REQUEST)
{
medit.setVisibility(View.VISIBLE);
mImageUri=data.getData();
String imageUri=getRealPathFromURI(mImageUri);
mImage.setImageURI(Uri.parse(imageUri));
}
@Mighter