开发者

issue with startActivityForResult in tab group in android

开发者 https://www.devze.com 2023-03-31 02:23 出处:网络
i have a 3 tabs in my app.One tab (Pitchin) requires replacing of the view, so i created a class that extends ActivityGroup.

i have a 3 tabs in my app.One tab (Pitchin) requires replacing of the view, so i created a class that extends ActivityGroup.

i used to replace the view like this:

View view = PitchinTab.group.getLocalActivityManager()  
                 .startActivity("Items", new 
                  Intent(Pitchin.this, send.class)   
                 .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))  
                 .getDecorView();  
                  PitchinTab.group.replaceView(view);

What my problem is, i need to call built in gallery from PitchIn class, For this i have done like this:

Intent intent = new Intent();

intent.setType("image/*");

intent.setAction(Intent.ACTION_GET_CONTENT);

startActivityForResult(Intent.createChooser(intent,"SelectPicture开发者_如何学编程"),SELECT_PICTURE);

And i am handling result in OnActivityResult like this:

public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == RESULT_OK) {
            if (requestCode == SELECT_PICTURE) {
                Uri selectedImageUri = data.getData();
                selectedImagePath = getPath(selectedImageUri);
                Uri uri = Uri.parse(selectedImagePath);
                test.setImageURI(uri);
      }
    }
  }

Gallery is opening but i cant get picture in my activity.i am unable to handle OnActivityResult,problem is due to i used ActivityGroup.

How to get result from gallery to Tab when using ActiviyGroup?

i find some links but i didnt get right solution yet, Please help me..

Thanks in advance...

0

精彩评论

暂无评论...
验证码 换一张
取 消