Tag: android-intent

Android: Understanding Intent-Filters

I would like to create an Intent-Filter, so that certain links will trigger the start of my application (see this stackoverflow-thread for example: How to register some URL namespace (myapp://app.start/) for accessing your program by calling a URL in browser in Android OS? ) While trying, I figured out, that I dont quite understand how […]

How do I tell if Intent extras exist in Android?

I have this code that checks for a value of an extra in an Intent on an Activity that is called from many places in my app: getIntent().getExtras().getBoolean(“isNewItem”) If isNewItem isn’t set, will my code crash? Is there any way to tell if it’s been set or not before I call it? What is the […]

Check if extras are set or not

Is there any way to check if an extra has been passed when starting an Activity? I would like to do something like (on the onCreate() in the Activity): Bundle extras = getIntent().getExtras(); String extraStr = extras.getString(“extra”); if (extraStr == null) { extraStr = “extra not set”; } But this is throwing a java.lang.NullPointerException. Thank […]

Animation transition between activities using FLAG_ACTIVITY_CLEAR_TOP

In my android app, I’m making a method that pop all activities and bring up the first activity. I use this code: Intent intent = new Intent(this, MMConnection.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); this.startActivity(intent); As I noticed that the transition was still a left to right animation, does someone know if there is a way to change system animation […]

Passing data through intent using Serializable

I’ve implemented my class with serializable, but it still didn’t work. This is my class: package com.ursabyte.thumbnail; import java.io.Serializable; import android.graphics.Bitmap; public class Thumbnail implements Serializable { private static final long serialVersionUID = 1L; private String label = “”; private Bitmap bitmap; public Thumbnail(String label, Bitmap bitmap) { this.label = label; this.bitmap = bitmap; } […]

How to navigate up to the same parent state

From my observation from Gmail and TED app the behavior of up navigation it will navigate to parent with the same state (scroll position) not like what Google say in their doc Implement Up Navigation which like create a parent intent and start it. I implement the code from Android sample code and all state […]

Multiple notifications to the same activity

I have an activity that is being opened from the notification bar, but when I do NotificationManager.notify(…), I’m giving to the intent a different bundle, so that each notification opens the same activity, but obtaining from the DB other information each other. But when I try to enter to any of the notifications (for example […]

How do you to check if a user has rated your app on the android market?

I want to check to see if a user has rated my app on the android market, not how many stars, just if they have. And if they haven’t I will prompt them with a dialog asking them to rate it with this code: startActivity( new Intent( Intent.ACTION_VIEW, Uri.parse(“market://details?id=packagename”) ) );

Android: How to share image with text on facebook via intent?

I’d like to share a photo with caption pre-filled from my app via a share intent, on facebook. Example code Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.setType(“image/*”); intent.putExtra(Intent.EXTRA_TEXT, “eample”); intent.putExtra(Intent.EXTRA_TITLE, “example”); intent.putExtra(Intent.EXTRA_SUBJECT, “example”); intent.putExtra(Intent.EXTRA_STREAM, imageUri); Intent openInChooser = new Intent(intent); openInChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents); startActivity(openInChooser); Here is screen shot what I get If a set type to […]

How to make notification intent resume rather than making a new intent?

What i have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again from any screen they want by pulling down the drop down menu and selecting it. Then when they want they can […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.