Bug #690
Can not start Orbot outside of an Activity
Status: | Closed | Start date: | 02/15/2013 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | n8fr8 | % Done: | 0% | |
Category: | - | |||
Target version: | 1.2 | |||
Component: |
Description
In OrbotHelper.requestOrbotStart you can not send the intent for Orbot to start outside of an Activity (from say an Application). If you add the flag, FLAG_ACTIVITY_NEW_TASK it works.
02-15 18:03:50.621: E/AndroidRuntime(24501): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
Intent intent = new Intent(URI_ORBOT);
intent.setAction(ACTION_START_TOR);
**intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
History
#1 Updated by n8fr8 almost 4 years ago
- Target version set to 1.2
#2 Updated by hans over 2 years ago
This is what you want in a Service
:
Intent intent = new Intent(OrbotHelper.ACTION_START_TOR); intent.setPackage(OrbotHelper.ORBOT_PACKAGE_NAME); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent);
#3 Updated by hans over 2 years ago
- Status changed from New to Closed