Tag: android-intent

How to use intent for choosing file browser to select file

How to use intent to prompt user to choose “finish action with” to choosing app to select file (assuming there is a few app to browse file in the device) I want to filter the file using an extension.. (eg. : *.sav, *.props) Thank you in advance

Use an intent to send data to my activity

I have a server running that notifies the user with a statusbar notification that opens my main activity, how can I pass data to my activity trough that intent?

“IntentReceiver components are not allowed to register to receive intents” when trying to determine Battery level

I am trying to get Battery info from my Application following the guidelines at http://developer.android.com/training/monitoring-device-state/battery-monitoring.html This is the method is came up with to check the battery level: public void sendBatteryInfoMessage(){ IntentFilter iFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED); Intent batteryStatus = c.registerReceiver(null, iFilter); int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING || status == […]

How to create Button Dynamically in android?

I want to create a page like this. these 7 buttons are already exist but if user want to add more categories (button) then he can do using + button and delete using – button. Any idea or tutorial for making this?

How do I set a EditText to the input of only hexadecimal numbers?

I would put in this code a control on EditText so that it only accepts hexadecimal numbers. How do I go about doing this? bin = (EditText)findViewById(R.id.editText02); hex = (EditText)findViewById(R.id.editText3); dec = (EditText)findViewById(R.id.editText1); oct = (EditText)findViewById(R.id.editText04);

How to Share Entire Android App with Share Intent

I have used Sharing-type intents before, such as: Intent intent = new Intent(Intent.ACTION_SEND); intent.setType(“plain/text”); intent.putExtra(Intent.EXTRA_EMAIL, new String[] { “—” }); intent.putExtra(Intent.EXTRA_SUBJECT, “—“); startActivity(Intent.createChooser(intent, “Contact Us!”)); However, this basically shares with Email/MMS and other text or document type apps. How do you do this same things but include Social sharing like Facebook, Twitter and Google Plus […]

Share Image File from cache directory Via Intent~android

I am trying to share image file in cache directory, i have the complete path, but not able to send the file in attachments, the code is File shareImage=Utils.getBitmapFile(); Log.d(“Activity”, “get final path in result”+shareImage.getAbsolutePath()); /*MimeTypeMap mime = MimeTypeMap.getSingleton(); String ext=shareImage.getName().substring(shareImage.getName().lastIndexOf(“.”)+1); String type = mime.getMimeTypeFromExtension(ext); shareIntent.setType(type); Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType(“image/*”); Uri shareImageUri = […]

How to find whether activity is last activity in stack

I am opening a link in my app and once back is pressed I want to show HomePage to retain user for some more time. I have been trying to acheive this but unable to do so. I get homeLauncher activity as my top as well as baseActivity. DeepLink Tap > Open desired Activity > […]

ActivityNotFoundException?

I am getting an ActivityNotFoundException in the following code: Main.java Intent intent = new Intent(); intent.setAction(“com.test.app.TEST”); startActivity(intent); // ActivityNotFoundException Manifest.xml <activity android:name=”.MainActivity” android:theme=”@android:style/Theme.Dialog”> <intent-filter> <action android:name=”com.test.app.TEST” /> </intent-filter> </activity>

Passing multiple flags to an intent in android

I have this activity that lists some information which I provide a refresh button for. The way I’m refreshing it (probably not the best way by any means) is just launching the activity all over again. To make the back stack work the way I need it to I need to pass in the FLAG_ACTIVITY_CLEAR_TOP […]

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