[AC-4448] Resuming of inactive Activity from module
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Hold |
Resolution Date | 2016-11-15T18:56:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Rainer Schleevoigt |
Assignee | Shak Hossain |
Created | 2016-09-12T11:31:41.000+0000 |
Updated | 2016-11-15T18:56:38.000+0000 |
Description
Hi,
I have built an interactive notification and try to "restart" the "frozen" activity by click. I mean the same action as I click on preview in taskmanager of operating system.
In Manifest I see 2 activities: one name with APPNAMEActivity and a second named "org.appcelerator.titanium.TiActivity". If I call an intent to first, then the app will restarted with running of splash intro. But I need the direct jump. Is it possible with Titanium and how?
Here the used snippet:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
String packageName = TiApplication.getInstance().getPackageName();
String className = packageName + "." + TiApplication.getAppRootOrCurrentActivity().getLocalClassName();
intent.setComponent(new ComponentName(packageName, className));
PendingIntent pendingIntent = PendingIntent.getActivity(ctx, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
builder = new NotificationCompat.Builder(ctx);
builder.setSmallIcon(R("notification_icon", "drawable"))
.setAutoCancel(false).setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setContentTitle("").setContentText("");
Hi, after some studies I know the way is usage of TaskStackBuilder to resume the activity. But the method addParentStack needs the class or classname of my last activity. All activities are named 'org.appcelerator.titanium.TiActivity'. How can I adress my custome activity? Is it a Titanium limitation? Cheers!
Hello, I believe this is how Appcelerator support activity. See http://docs.appcelerator.com/platform/latest/#!/guide/Android_Intent_Filters