android

How can I add registerOnSharedPreferenceChangeListener on to a ListActivity?

When I call intent public class TInfo extends ListActivity implements OnSharedPreferenceChangeListener{ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); prefs = PreferenceManager.getDefaultSharedPreferences(this); initvars(); setListAdapter(new TAdapter()); // class TAdapter extends ArrayAd...

Null Pointer Exception when using delete

AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); dDbHelper.deletedJournal(info.id); mDbHelper.deleteJournal(info.id); public boolean deletedJournal(long homeId){ return mDb.delete(DATABASE_TABLE, KEY_HOMEID + "=" + homeId, null )>0; } dDbHelper.deletedJournal(in...

Selection list cut off in AutoCompleteTextView in Dialog

I have a dialog window that covers 1/3 of the entire screen height and is displayed on top of my activity. The dialog holds two AutoCompleteTextView fields. The problem I'm facing is that when the user starts typing something into the AutoCompleteTextView, the list with all suggestions only shows up to the bottom end of the dialog, but ...

Android minSdkVersion and using classes introduced in higher level SDK

I was testing android minSDKVersion property and find a strange behavior- I put minSDKVersion=3 (1.5) and targetSDKVersion=4 (1.6) in androidManifest.xml file. For testing, I put following lines in onCreate method of launching activity - android.telephony.SmsManager sm = android.telephony.SmsManager.getDefault(); ArrayList<String> s...

Android: Floating Bar in Layout

Does anyone know how to add a floating bar that will stay at the top of a layout page, even when a user is scrolling through the contents of that layout? ...

android listview nullpointer.exception

Hi guys, Im trying to display this listview, but I keep getting a: 07-17 21:14:22.233: ERROR/AndroidRuntime(349): java.lang.NullPointerException I think I know what the problem is but I dont know how to fix it. I have a String array which I will be using to be displayed in my list parser topicparser = new parser(); final Strin...

Difficulty displaying alert dialog, why does this code force close my app?

I'm very new to Android so I've been working primarily with information from the android developer's page. Everything was going great until I added the code from the alert dialog section. The code they give alone gives me an error when I try to run it on the last line, saying I must initialize dialog, but I feel like I'm getting the Nu...

Will TIME_TICK broadcast in deep sleep?

Does Android wake from deep sleep in order to broadcast ACTION_TIME_TICK? From experimenting, I don't think it does, but I'm looking for a definitive answer. My experiment involved registering a simple BroadcastReceiver to update a TextView on receive: registerReceiver(new BroadcastReceiver() { int ctr = 0; @Override publi...

Failing with multiply instances

Hi all, I`am trying to launch an Intent filter from one proccess to run an activity of another proccess. this is pretty easy: protected void startIntent() { Intent i = new Intent(target); i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); context.startActivity(i); ...

How can I retrieve a imageview in a ListView that is not being selected?

I set my listview as follows and can change the icon that I am clicking to pause. However I cannot figure how to select an icon to change back to play that was clicked earlier. public View getView(int position, View convertView, ViewGroup parent) { final int posi = position; View row=convertView; if (row==null) ...

How to link to an RTSP stream on Android phone?

I need to play an RTSP audio stream on an Android phone, linked to from a web-page. What's the simplest way to achieve this? I hope this will be very simple but unfortunately I don't have a phone on which to test. ...

Android Best Practice on Updating the UI from BroadcastReceiver to a certain activity

When i have a broadcastReceiver say android.intent.action.MEDIA_BUTTON and i want to update the current activity's UI without creating a new activity, is there any good practice on this one? What i know (might not be correct) 1) I can put the BroadcastReceiver in the same class as the activity and call the updateUI function after certa...

LinearLayout in ExpandableListView

Hi guys, I want to inflate a childView of ExpandableChildView component. Code: public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { View v = convertView; LinearLayout linearOpt = themesOptions.get(childPosition); if(v == null) { ...

How to use a XML shape drawable?

I defined a drawable <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http//schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#ffffffff" /> <size android:width="60dp" android:height="40dp" /> </shape> But how to use it in the layout definition? <?xml version="1.0" enc...

Android Set Text to TextView

Hi out there, have a problem, setting a Text to a TextView. TextView android:editable = "true". In my .java it seems like that text = (EditText) findViewById(R.id.this_is_the_id_of_textview); text.setText("TEST"); But it doesnt work, dont know, whats wrong..hope u can help me:) ...

How can you upload photos from android gallery to server?

Hello, I am writing an android application in which users can pick a photo from their gallery and upload it to a server. How should I accomplish this ? The application mainly uses SOAP webservices to communicate with the server, but I do not know how to serialize a stream of bytes in KSOAP and therefore I need some help. The solution sh...

How to display animation image like the Quick Search Box

I have implemented an activity that retrieves data from a web service and display it in the AutoCompleteTextView. This has been working quite well. I'm interested in displaying a spinning animation while the data is being retrieved (The same effect like the Quick Search Box) I try to figure out how the QSB is doing it (10x Open Sour...

the application has stopped unexpectedly

I have built a game. When the user clicks a button on the main page, he is redirected to another activity for a predefined time(say 20 s) and then he returns to the main page where he can choose another button. Now, this works perfectly on the emulator but on the phone when I clicks another button on the main page, it says the applicatio...

I'm getting a NullPointerException when I use ACTION_IMAGE_CAPTURE to take a picture

I have a fairly simple app that launches the camera from a menu. The camera launches fine, but when I hit ok after taking a picture I get a NPE on my nexus one: E/AndroidRuntime( 3891): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {net.asplode.tr/net.asplode.tr.P...

Creating a skeleton for a Game Algorithm in Android

Hello. I need some help on the following: I have the following class: public class Game extends Activity {... ...} My questions is: Where and how do I create my View (do I use another class that extends View....) Where and how do I implement the Runnable interface so I would be able to use threads. Where and how do I connect all...