Tag: android-intent

Android start activity on Menu Item selection

I have 2 classes. One will be a basic instructions screen and on that screen it will have a menu that will let you go to the other class. The other class is a MapActivity. I believe the problem is that its not finding the other class. I’ve tried a few different ways of declaring […]

Intent Service never getting called

I am trying out Intent services. This is what I use to call it Button updateLocation = (Button) findViewById(R.id.btnUpdateLocation); updateLocation.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Intent updateLocIntent=new Intent(ImTracking.this,UpdateLocation.class); startService(updateLocIntent);}}); However in my UpdateLocation class, it never hits any of my break points. public class UpdateLocation extends IntentService{ […]

Moving from one activity to another Activity in Android

I want to move from one activity to another (using virtual device). When I click on button to move, My emulator ones a dialog box showing unfortunately SMS1 has stopped working (SMS1 is my app name). Can anybody help me in correcting my code? MainActivity.java: package com.example.sms1; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; […]

Why isn't my app on the list of apps to open txt file?

I have an text reader app that is designed to receive intent from Android system when I click on a text file to open it. But my app isn’t on the list popped up by the system. Below are my codes: Manifest <?xml version=”1.0″ encoding=”utf-8″?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.broadcastreceivertest1″ android:versionCode=”1″ android:versionName=”1.0″ > <uses-sdk android:minSdkVersion=”8″ /> <application […]

How to determine the type of an extra in a bundle held by intent?

I am trying to pass arbitrary data to a BroadcastReceiver through its Intent. So I might do something like the following intent.putExtra(“Some boolean”, false); intent.putExtra(“Some char”, ‘a’); intent.putExtra(“Some String”, “But don’t know what it will be”); intent.putExtra(“Some long”, 15134234124125); And then pass this to the BroadcastReceiver I want to iterate through Intent.getExtras() with something like […]

Array List Intent extra in Java

I am trying to skip my ArrayList through Intent. But I cannot find what to write in extra? Any get methods I am getting errors like “not applicable for string.” Item Details: public class ItemDetails { public String getName() { return name; } public void setName(String name) { this.name = name; } public String getItemDescription() […]

Android – Showing Phonebook contacts and selecting one

I want to show the list of contacts in phonebook on a click of a button and then select one of the contacts from it and then retrieve its contact number? I dont want to make my custom list, is there a way to use androids built in functionality?

Clear Activity back stack

This question already has an answer here: Android: Clear the back stack 25 answers

Unmarshalling unknown type code

What I am basically trying to do is pass a Parcelable object as an Intent extra. Here is where I pass it, final Intent intent = new Intent(_context, AddReminderActivity.class); final Bundle bundle = new Bundle(); bundle.putString(AddReminderActivity.EXTRA_MODE, AddReminderActivity.MODE_EDIT); bundle.putParcelable(AddReminderActivity.EXTRA_REMINDER, _reminders.get(position)); intent.putExtras(bundle); _context.startActivity(intent); _reminders is an ArrayList<Reminder> Here is my Reminder class package au.com.elegantmedia.vetcheck.objects; import android.os.Parcel; import […]

Android Studio – Illegal character 8204 error

For some reason, after rebuilding my project I get an illegal character error but nothing within my code gets underlined in red. Can someone please tell me what is wrong and how to resolve it? Error illegal character: \8204 WCBankActivity.java import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBarActivity; public class WCBankActivity extends ActionBarActivity { public […]

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