android – Can't use @string notation to define <intent-filter> in AndroidManifest.xml-ThrowExceptions

Exception or error: My BroadcastReceiver never gets called when I use “@string/action_name” to define the intent filter action. If I copy/paste the corresponding string from strings.xml into AndroidManifest.xml, then it works perfectly! Non working example from AndroidManifest.xml: <receiver android:name=”.ServerUpdateReceiver” > <intent-filter> <action android:name=”@string/ACTION_INFORM_USER_SERVER_UPDATE” /> </intent-filter> </receiver> Working example from AndroidManifest.xml: <receiver android:name=”.ServerUpdateReceiver” > <intent-filter> <action …

Referencing an XML string in an XML Array (Android)-ThrowExceptions

Exception or error: in arrays.xml <string-array name=”my_items”> <item>My item 1</item> <item>My item 2</item> <item>My item 3</item> </string-array> in strings.xml <resources> <string name=”item1″>My item 1</string> <string name=”item2″>My item 2</string> <string name=”item3″>My item 3</string> </resources> I would like to reference the string in the array “My item 1” from strings.xml. How do I do that? How to …

Is String a primitive or an Object in Android or Java?-ThrowExceptions

Exception or error: In the Android API http://developer.android.com/guide/topics/data/data-storage.html#pref It says: Shared Preference allows you to save and retrieve persistent key-value pairs of primitive data types. You can use SharedPreferences to save any primitive data: booleans, floats, ints, longs, and strings. Is String a primitive data type or an Object? How to solve: As far as …

java – Android : date format in a String-ThrowExceptions

Exception or error: I have a problem to sort date because of the format of these dates. I obtain the date : final Calendar c = Calendar.getInstance(); mYear = c.get(Calendar.YEAR); mMonth = c.get(Calendar.MONTH); mDay = c.get(Calendar.DAY_OF_MONTH); And I build a String with these values. dateRappDB = (new StringBuilder() .append(mYear).append(“.”) .append(mMonth + 1).append(“.”) .append(mDay).append(” “)).toString(); The …

android – Array String Declaration-ThrowExceptions

Exception or error: I have a frustrating issue which could be easy. Arrays in java seem to be frustratingly not intuitive. I have an String array called title it has several titles here is part of the array private String[] title = { “Abundance”, “Anxiety”, “Bruxism”, “Discipline”, “Drug Addiction” } This part seems OK in …

android – concatenate two strings-ThrowExceptions

Exception or error: Let’s say I have a string obtained from a cursor,this way: String name = cursor.getString(numcol); and another String like this one: String dest=cursor.getString(cursor.getColumnIndexOrThrow(db.KEY_DESTINATIE)); If finally I wanna obtain a String from the two of them,something like: name – dest Let say if name=Malmo and dest=Copenhagen How could I finally obtain Malmo-Copenhagen??? Because …

android – Convert String text to Bitmap-ThrowExceptions

Exception or error: Is it possible to convert string text that is inside an EditText box into a Bitmap? In other words, is there any way to convert string text into a Bitmap that means the text will display as an image? Below is my Code: class TextToImage extends Activity { protected void onCreate(Bundle savedInstanceState) …