开发者

Impossible to start ACTION_SEND activity in my activitiesManager / Strange behavior of onKeyUp event

开发者 https://www.devze.com 2023-04-13 01:17 出处:网络
In my android application, I use my own ActivityGroup (named TabGroupActivity) in order to manage several activities in a tabHost.

In my android application, I use my own ActivityGroup (named TabGroupActivity) in order to manage several activities in a tabHost.

So, when I want start a activity, I use the following method of TabGroupActivity :

public void startChildActivity(String Id, Intent intent) {
      Window window = getLocalActivityManager().startActivity(Id,intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
      if (window != null) 
      {
          mIdList.add(Id);
          setContentView(window.getDecorView());
      }    
  }

The problem is when I try to s开发者_StackOverflowtart a ACTION_SEND intent with this method. I have the following error :

java.lang.SecurityException: Requesting code from com.android.mms to be run in process com.myProject

Someone can tell me if it's possible to start a activity like "ACTION_SEND" with this method ? The problem seems to come from the "getLocalActivityManager.startActivities" ?

For now, to avoid this error, I call startActivity without use TabGroupActivity.startChildActivity but I have a really strange behavior of the ACTION_SEND activity !!

I explain : In TabGroupActivity the fonction onKeyUp is override so I put a Log when I enter in this fonction.

And when I use the back button in order to quit the mail_activity my Log is printed half the time!! totally random !! I don't understand why !

Thank you for your help :)


For java.lang.SecurityException : you need to add the permission in the AndroidManifest file. since you are trying to do something with Messaging application(com.android.mms).

0

精彩评论

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