trungdh / apndroid

Automatically exported from code.google.com/p/apndroid
0 stars 0 forks source link

API only working when widget is on desktop #95

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using the following code from my service

boolean targetState = false; 
Intent intent = new Intent(ApplicationConstants.CHANGE_STATUS_REQUEST); 
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(ApplicationConstants.TARGET_APN_STATE, targetState ? 
ApplicationConstants.State.ON : ApplicationConstants.State.OFF);
context.startActivity(intent); 

but it only seems to work if I have the widget on my home screen.

running on gingerbread 2.3.3 (CM7) using latest beta of apndroid

Original issue reported on code.google.com by louis.st...@gmail.com on 27 Apr 2011 at 9:26

GoogleCodeExporter commented 9 years ago
logcat without widget

I/ActivityManager(  161): Starting: Intent { 
act=com.google.code.apndroid.intent.action.CHANGE_REQUEST flg=0x10000000 
cmp=com.codecarpet.apndroid.dev/com.google.code.apndroid.ActionActivity (has 
extras) } from pid 9943
I/ActivityManager(  161): Start proc com.codecarpet.apndroid.dev for activity 
com.codecarpet.apndroid.dev/com.google.code.apndroid.ActionActivity: pid=10013 
uid=10078 gids={3003}
I/apndroid.log(10013): MMS target state is unspecified
I/apndroid.log(10013): Show notification icon setting is unspecified
I/ActivityManager(  161): Displayed 
com.codecarpet.apndroid.dev/com.google.code.apndroid.ActionActivity: +594ms

logcat with widget

I/ActivityManager(  161): Starting: Intent { 
act=com.google.code.apndroid.intent.action.CHANGE_REQUEST flg=0x10000000 
cmp=com.codecarpet.apndroid.dev/com.google.code.apndroid.ActionActivity (has 
extras) } from pid 9943
I/ActivityManager(  161): Displayed 
com.codecarpet.apndroid.dev/com.google.code.apndroid.ActionActivity: +118ms
I/apndroid.log(10013): MMS target state is unspecified
I/apndroid.log(10013): Show notification icon setting is unspecified
I/apndroid.log(10013): switching apn state [target=false, mmsTarget=true, 
showNotification=false]
D/apndroid.log(10013): sending switch in progress broadcast
D/apndroid.log(10013): sending switch in progress broadcast received in widget 
handler
I/apndroid.log(10013): switch success=true
D/apndroid.log(10013): received connection state changed broadcast

Original comment by louis.st...@gmail.com on 27 Apr 2011 at 9:37