Tag: android-intent

Retaining android app state using alwaysRetainTaskState and lauchMode

In my Android app, I have a main activity that serves as an entry point to my application, which is configured in my manifest file like this : <activity android:name=”.Main” android:label=”@string/app_name” android:screenOrientation=”portrait” android:alwaysRetainTaskState=”true” android:launchMode=”singleTask”> <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> </activity> So for a particular use case, lets say a user starts up […]

data.getExtras().get(“data”) result of low resolution image in android

In my app I take a picture from camera and then I get that picture to do some image processing operations on same picture but when I get this picture with data.getExtras().get(“data”) , picture come with low resolution not real taken resolution. What can be reason of the problem? Code is like that; Intent intent […]

Will someone please explain RESULT_FIRST_USER

I don’t understand the meaning, value, or importance of RESULT_FIRST_USER, other than that my own result codes must be greater than 1. Will someone please explain it? RESULT_OK and RESULT_CANCELED make perfect sense to an english speaker. But what in the world of android is RESULT_FIRST_USER? All the documentations says about it is Start of […]

Android launch applications detail page

I’m working on an application where I list the installed applications with the package manager. I can get the package name of the item clicked, but I’d like to then launch the details screen based on the package. So for instance if Dolphin Browser were selected in the list, you would then see the following […]

Android – How to intercept the 'Install application' intent

OK, so not entirely sure this is possible… But trying to write an application so that I can run some code before any of the following activities are performed. 1) APK is downloaded from web and market launches installer 2) Install button is pressed on android market Is it possible to intercept and prompt on […]

Android: Intent Flag to destroy activity and start new one

So I have a Login Activity This Activity inflates a login.xml layout which has a USER_NAME and PASSWORD EditText Views, when I enter the Username and Password and click the Login Button I start a new Activity. The new Activity has a Logout button which basically just starts the previous Activity like so: Intent loginIntent […]

Sending Email from Android app when click on button

I need to provide feature for users where users can share some data by sending email. I used below code. Intent email = new Intent(android.content.Intent.ACTION_SENDTO); email.setType(“message/rfc822″); email.putExtra(Intent.EXTRA_EMAIL, new String[] { to }); email.putExtra(Intent.EXTRA_SUBJECT, subject); email.putExtra(Intent.EXTRA_TEXT, message); startActivity(Intent.createChooser(email,”Choose an Email client :”)); This shows Email, gmail, Skype and send via bluetooth for user to choose. I […]

SINGLE_TOP | CLEAR_TOP seem to work 95% of the time. Why the 5%?

I have a nearly-finished application with a non-trivial activity structure. There are push notifications associated with this app, and selecting the notification entry is supposed to bring up a specific activity regardless of whether the app is foreground/background/not active. If the app is not active, I have been able to successfully start the app and […]

How to tell which app was selected by Intent.createChooser?

Code: Intent launchIntent = new Intent(Intent.ACTION_MAIN); launchIntent.addCategory(Intent.CATEGORY_HOME); Intent chooser = Intent.createChooser(launchIntent, “Complete Action using..”); activity.startActivity(chooser); I don’t see any way to tell which Intent (HOME category launcher) was selected. There is no Inent.addOnActionSetListener, and no chooser.addOnIntentChosenListener etc. So how can I tell which was selected? Do Or do I have to write my own chooser […]

Not an enclosing class error Android Studio

I am new in android development and do not have an in depth knowledge of Java. I am stuck on a problem for a long time. I am trying to open a new activity on button click. But I am getting an error that error: not an enclosing class: Katra_home. Here is the code for […]

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