Click here to Skip to main content
15,898,729 members
Home / Discussions / Android
   

Android

 
AnswerRe: detect when the dialog is load in android - And do something in response to Pin
goldsoft4-Oct-14 0:25
goldsoft4-Oct-14 0:25 
GeneralRe: detect when the dialog is load in android - And do something in response to Pin
Richard MacCutchan4-Oct-14 0:47
mveRichard MacCutchan4-Oct-14 0:47 
AnswerRe: detect when the dialog is load in android - And do something in response to Pin
David Crow2-Oct-14 8:23
David Crow2-Oct-14 8:23 
GeneralRe: detect when the dialog is load in android - And do something in response to Pin
goldsoft2-Oct-14 9:52
goldsoft2-Oct-14 9:52 
Questionswiping the screen canvas is drawn using bitmap Pin
Member 1110878929-Sep-14 0:46
Member 1110878929-Sep-14 0:46 
QuestionExtracting json and display data in options menu as a menuitems. Pin
Member 1110878926-Sep-14 0:29
Member 1110878926-Sep-14 0:29 
SuggestionRe: Extracting json and display data in options menu as a menuitems. Pin
Richard MacCutchan26-Sep-14 0:40
mveRichard MacCutchan26-Sep-14 0:40 
GeneralRe: Extracting json and display data in options menu as a menuitems. Pin
Member 1110878926-Sep-14 0:52
Member 1110878926-Sep-14 0:52 
The code for how I extracted from json:

if((jsonarray.get(0).toString()) != null){
JSONObject jsonobj = new JSONObject(jsonarray.get(0).toString());
Log.e("aptlist", jsonobj.toString());

JSONArray array1= jsonobj.getJSONArray(TAG_APTLIST);

String a1= array1.get(0).toString();
String a2= array1.get(1).toString();
String a3= array1.get(2).toString();
String a4= array1.get(3).toString();
String a5= array1.get(4).toString();


}

Now I want those a1,a2,a3,a4,a5 values in optionsmenu when I click.

I tried as below,but got error as NullPointException

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
getMenuInflater().inflate(R.menu.main, menu);


SubMenu submenu = menu.addSubMenu("Select Apartment");

submenu.add(a1);
Log.e("msg from a1", a1.toString());
submenu.add(a2);
submenu.add(a3);
submenu.add(a4);
submenu.add(a5);

return true;
}
GeneralRe: Extracting json and display data in options menu as a menuitems. Pin
Richard MacCutchan26-Sep-14 1:01
mveRichard MacCutchan26-Sep-14 1:01 
QuestionExtracting name and values from JSON object Pin
Member 1110878925-Sep-14 0:01
Member 1110878925-Sep-14 0:01 
AnswerRe: Extracting name and values from JSON object Pin
Richard MacCutchan25-Sep-14 0:49
mveRichard MacCutchan25-Sep-14 0:49 
GeneralRe: Extracting name and values from JSON object Pin
Member 1110878925-Sep-14 1:02
Member 1110878925-Sep-14 1:02 
GeneralRe: Extracting name and values from JSON object Pin
Richard MacCutchan25-Sep-14 1:16
mveRichard MacCutchan25-Sep-14 1:16 
Questioncalendar Pin
Member 1109476019-Sep-14 2:22
Member 1109476019-Sep-14 2:22 
AnswerRe: calendar Pin
Richard MacCutchan19-Sep-14 3:47
mveRichard MacCutchan19-Sep-14 3:47 
AnswerRe: calendar Pin
David Crow23-Sep-14 9:34
David Crow23-Sep-14 9:34 
QuestionRoboMVVM - AN Open Source MVVM framework for Android Pin
Debdatta Basu15-Sep-14 7:21
Debdatta Basu15-Sep-14 7:21 
AnswerRe: RoboMVVM - AN Open Source MVVM framework for Android Pin
Richard MacCutchan15-Sep-14 21:33
mveRichard MacCutchan15-Sep-14 21:33 
GeneralRe: RoboMVVM - AN Open Source MVVM framework for Android Pin
Debdatta Basu15-Sep-14 23:26
Debdatta Basu15-Sep-14 23:26 
GeneralRe: RoboMVVM - AN Open Source MVVM framework for Android Pin
Richard MacCutchan16-Sep-14 2:26
mveRichard MacCutchan16-Sep-14 2:26 
Questionhow to set alarm to repeat monthly Pin
sharath198410-Sep-14 23:55
sharath198410-Sep-14 23:55 
AnswerRe: how to set alarm to repeat monthly Pin
Richard MacCutchan11-Sep-14 0:38
mveRichard MacCutchan11-Sep-14 0:38 
QuestionRe: how to set alarm to repeat monthly Pin
David Crow19-Sep-14 4:33
David Crow19-Sep-14 4:33 
QuestionFragmentTabHost with scrolling tabs Horizontal (xamarin-C#) Pin
jojoba2010-Sep-14 1:29
jojoba2010-Sep-14 1:29 
QuestionAndriod Listview using c# Pin
Vinojegan8-Sep-14 3:21
Vinojegan8-Sep-14 3:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.