Data is perfectly display in simulator bit it is issued in
simulator,Basically what i am trying to do.i have 4 spinner in My
Activity.each one is filled from server Json data using Async data
here is my code ..
locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
str=TAG_CC1HeadingData;
String url=String.format("json url");
try {
jParser = new JSONParser();
json = jParser.getJSONFromUrl(url);
} catch (Exception e) {
// TODO Auto-generated catch block
//Log.v("Json data From Server: ", e.getMessage());
e.printStackTrace();
}
str=TAG_CC1HeadingData;
new AyncdataFromServer().execute(str);
str=TAG_CC2HeadingData;
new AyncdataFromServer().execute(str);
str=TAG_CC3HeadingData;
new AyncdataFromServer().execute(str);
str=TAG_CC4HeadingData;
new AyncdataFromServer().execute(str);
str=TAG_CC5HeadingData;
new AyncdataFromServer().execute(str);
}
@Override
protected ArrayList doInBackground(String... params) {
// TODO Auto-generated method stub
ArrayListCC1List=new ArrayList();
try
{
//Log.v("param",params[0]);
// Getting Array of Contacts
contacts = json.getJSONArray(params[0]);
// looping through All Contacts
JSONArray CC1array = json.getJSONArray(params[0]);
// looping through All Contacts
for(int i = 0; i < CC1array.length(); i++)
{
JSONArray jc = CC1array.getJSONArray(i);
CC1List.add(new
DataCCHeading(jc.getString(1).toString(),jc.getString(0).toString(),params[0]));
}
}
catch(Exception ex)
{
//Log.i(params[0], ex.toString());
ex.printStackTrace();
}
return CC1List;
}
public class AyncdataFromServer extends AsyncTask>
{
@Override
protected void onPostExecute(ArrayList result) {
// TODO Auto-generated method stub
ArrayListhd=new ArrayList(result);
if(hd.size()>0)
{
Log.v("str", hd.get(0).Ownername);
if(hd.get(0).Ownername==TAG_CC1HeadingData)
{
ArrayAdapteradaptercc1=new
ArrayAdapter(TimeClockDashBoard.this,android.R.layout.simple_spinner_item
,result);
adaptercc1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
myCC1Spinner.setAdapter(adaptercc1);
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en07-10 02:56:34.022: D/AndroidRuntime(28052): Shutting down VM
07-10 02:56:34.022: W/dalvikvm(28052): threadid=1: thread exiting with uncaught
exception (group=0x40a551f8)
07-10 02:56:34.022: E/AndroidRuntime(28052): FATAL EXCEPTION: main
07-10 02:56:34.022: E/AndroidRuntime(28052): java.lang.RuntimeException: Unable
to start activity
ComponentInfo{com.android.mobileTimerClock/com.android.mobileTimerClock.TimeClockDashBoard}:
java.lang.NullPointerException: println needs a message
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.app.ActivityThread.access$600(ActivityThread.java:123)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.os.Handler.dispatchMessage(Handler.java:99)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.os.Looper.loop(Looper.java:137)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
android.app.ActivityThread.main(ActivityThread.java:4424)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
java.lang.reflect.Method.invokeNative(Native Method)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
java.lang.reflect.Method.invoke(Method.java:511)
07-10 02:56:34.022: E/AndroidRuntime(28052):at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-10 02:56:34.022: E/And