What intent-filters must my app cover to appear in chooser when requestion an image from an external app?

I had covered the correct intent-filters, however the Tumblr app requires the category OPENABLE, so instead of the filters I had I’m now using: <intent-filter> <action android:name=”android.intent.action.PICK” /> <category android:name=”android.intent.category.DEFAULT” /> <data android:mimeType=”image/*” /> </intent-filter> <intent-filter> <action android:name=”android.intent.action.GET_CONTENT” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.OPENABLE” /> <data android:mimeType=”image/*” /> </intent-filter> Only adding the line: <category android:name=”android.intent.category.OPENABLE” … Read more

android unlock screen intent?

Yes, the ACTION_USER_PRESENT is broadcasted after the user unlocks: http://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT Note that this is a protected broadcast and if the user is using a lock screen replacement such as WidgetLocker or NoLock the USER_PRESENT may not be sent or may be sent at the wrong time. For detecting WidgetLocker‘s unlock see: http://teslacoilsw.com/widgetlocker/developers

Android AlarmManager problem with setting & resetting an alarm

When canceling the AlarmManager do not use a PendingIntent with a flag of FLAG_CANCEL_CURRENT. Instead, cancel the PendingIntent explicitly after canceling the alarm: am = (AlarmManager) getSystemService(getApplicationContext().ALARM_SERVICE); Intent i = new Intent(getApplicationContext(),AlarmReceiver.class); PendingIntent p = PendingIntent.getBroadcast(getApplicationContext(), 0, i, 0); am.cancel(p); p.cancel();

How to load an image in image view from gallery?

public class ImageGalleryDemoActivity extends Activity { private static int RESULT_LOAD_IMAGE = 1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button buttonLoadImage = (Button) findViewById(R.id.buttonLoadPicture); buttonLoadImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { Intent i = new Intent( Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, RESULT_LOAD_IMAGE); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) … Read more

Android Alert dialog from inside an intent service

Need Activity for display AlertDialog, because we can’t display Dialog from any Service Solution. Create Activity as Dialog Theme and start that Activity from Service. Just need to register you Activity in menifest.xml like as below android:theme=”@android:style/Theme.Dialog” or android:theme=”@android:style/Theme.Translucent.NoTitleBar” MyDialog.java public class MyDialog extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final AlertDialog … Read more

Alarm Manager does not work in background on Android 6.0

There are a couple of things you can try which, when used in concert, should be able to cut through all of the idle/standby/doze modes (irrespective of OS version). 1. Use a WakefulBroadcastReceiver instead of an ordinary BroadcastReceiver. Make sure you include the WAKE_LOCK permission to use it correctly. 2. Use the setExactAndAllowWhileIdle() method (on … Read more

How to use Intent.ACTION_APP_ERROR as a means for a “feedback” framework in Android?

This was solved with the help from the link in @TomTasche comment above. Use built-in feedback mechanism on Android. In my AndroidManifest.xml I added the following to the <Activity> where I want to call the Feedback agent from. <intent-filter> <action android:name=”android.intent.action.APP_ERROR” /> <category android:name=”android.intent.category.DEFAULT” /> </intent-filter> And I made a simple method called sendFeedback() (code … Read more