Skip to content
Advertisement

Tag: android-intent

Android: pass data from initial activity (launching Zxing scanner) to onActivityResult callback

I use the library zxing-android-embedded in my Android App. Before calling initiateScan() method to start the scanner from my activity, I set a class variable scanedItemId to know on which item I clicked to scan: Then I get the result via onActivityResult method. It works well but my class variable scanedItemId is null because the activity is relaunched. Is it

Using Intent.createChooser and getting error: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag

I want to open the share via option from the service class. It is working fine in Android 7, but in 8+ OS it starts showing android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? I have also included this flag to my Intent, but it’s still showing the same

How to show Heads up notifications android

How to get a heads up notification.With below code i can only see three dots on status bar and a notification in notification bar. Answer I was having the same problem, but I was using the newer NotificationCompat.Builder() call which requires a channel ID from a NotificationChannel. The notification will only appear as a heads-up notification if the NotificationChannel is

Advertisement