Tag: android-intent

Android4.4 can not handle sms intent with “vnd.android-dir/mms-sms”

My application has a button to start default sms activity and it worked perfectly fine all android version except new one, Android 4.4(kitkat) Here is the code: public void onClick(View arg0) { Intent smsIntent = new Intent(Intent.ACTION_VIEW); smsIntent.setType(“vnd.android-dir/mms-sms”); smsIntent.putExtra(“address”, member.getPhoneNumber().trim()); context.startActivity(smsIntent); } And I get error messages 11-08 02:08:32.815: E/AndroidRuntime(14733): android.content.ActivityNotFoundException: No Activity found to […]

Dealing with implicit intent future deprecation in Lollipop

To transmit data to other applications I’ve been using implicit intents as in examples below: Intent intent = new Intent(); intent.setAction(“com.example.OpenURL”); intent.putExtra(“URL_TO_OPEN”, url_string); sendOrderedBroadcastAsUser(intent); Intent intent = new Intent(); intent.setAction(“com.example.CreateUser”); intent.putExtra(“Username”, uname_string); intent.putExtra(“Password”, pw_string); sendBroadcast(intent); Intent intent = new Intent(); intent.setAction(“com.example.BackupUserData”); intent.setData(file_uri); intent.addFlags(FLAG_GRANT_READ_URI_PERMISSION); sendBroadcast(intent); But this behavior is not recommended anymore in Android 5.0 http://developer.android.com/about/versions/android-5.0-changes.html […]

overridePendingTransition not working

I’m trying to implement a transition in my app but overridePendingTransition(anim, anim) is not working correctly. I have window transitions enabled After debugging the code I can say that the compiler does execute the call but it is NOT shown I have tried calling finish() before overridePendingTransition() this does not seem to have any effect […]

How to get Ringtone name in Android?

I’m allowing my user to pick a ringtone for notifications in my app. I want to store the URI of the sound along with the human readable title of the sound. So far the URI code works great: Uri uri = intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI); But when I try to get the title, and set it as a […]

Passing arraylist of objects between activities

I am trying to pass an arraylist of objects between two activities, but my app crushes at the second activity. Can someone help me solve this problem… Here is my code from my first activity: Intent i = new Intent(); Bundle b = new Bundle(); b.putParcelableArrayList(“songs”,(ArrayList<? extends Parcelable>) albumsArray.get(position).getSongs()); Log.v(“–“, “OK”); i.putExtras(b); i.setClass(LatestAlbums.this, AlbumDetails.class); startActivity(i); […]

Passing ArrayList of objects through intent – Java (Android)

I am trying to pass an ArrayList of objects through an intent but cannot get it to work. Here is what I have: public class QuestionView extends Activity { //variables and other methods… public void endQuiz() { Intent intent = new Intent(QuestionView.this, Results.class); intent.putExtra(“correctAnswers”, correctAnswers); intent.putExtra(“wrongAnswers”, wrongAnswers); intent.putParcelableArrayListExtra(“queries”, queries); startActivity(intent); } } Intents are being […]

Android – matching a url pattern?

I’d like one of my activities to pick up a particular url. The pattern is: http://www.example.com/abc123/foo/xyz789 The path components “abc123” and “xyz789” can be any sequence of alpha-numerics, length > 1. Doing this in my manifest: <activity> <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <category android:name=”android.intent.category.BROWSABLE” /> <data android:scheme=”http” android:host=”example.com” android:pathPattern=”/.*/foo/.*” /> but it seems […]

How to open a website when a Button is clicked in Android application?

I am designing an app, with several button for users to click on. Once button is clicked, user is directed to appropriate website. How do I accomplish this?

Android launch Twitter intent

I use the code below for launching twitter intent but is not working. I have the twitter app installed on my phone. Need help! Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType(“text/plain”); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, “Content to share”); PackageManager pm = contexto.getPackageManager(); List<ResolveInfo> activityList = pm.queryIntentActivities(shareIntent, 0); for (final ResolveInfo app : activityList) { if (“com.twitter.android.PostActivity”.equals(app.activityInfo.name)) { final ActivityInfo […]

Make call using a specified SIM in a Dual SIM Device

I have been searching for this from past few days and I came to know that: “Dual SIM is not supported in Android out of the box. It is a custom modification by manufacturers, and there is no public API to control it.” There is a solution provided in the below link but its not […]

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