Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
java.lang.IllegalStateException: Content view not yet created
Gil Carvalho
Ranch Hand
Posts: 80
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
This is my code, i'm having a problem with this error at line 53
ListView lv = getListView();
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.requisicoes, container, false); final UserFunctions userFunctions = new UserFunctions(); if (userFunctions.isUserLoggedIn(getActivity())) { MainActivity activity = (MainActivity) getActivity(); final String idUser = activity.getMyUserId(); Log.d("getMyUserId", idUser); JSONObject json = userFunctions.verReq(idUser); reqEfetuadas = new ArrayList<HashMap<String, String>>(); ListView lv = getListView(); Log.d("Todas Reservas: ", json.toString()); try { Log.d("Sucesso", TAG_SUCCESS); if (json.getString(TAG_SUCCESS) != null) { String res = json.getString(TAG_SUCCESS); if (Integer.parseInt(res) == 1) { reqFeitas = json.getJSONArray(TAG_RESERVAS); for (int i = 0; i < reqFeitas.length(); i++) { JSONObject c = reqFeitas.getJSONObject(i); String id = c.getString(TAG_ID); String data = c.getString(TAG_DATA); HashMap<String, String> map = new HashMap<String, String>(); map.put(TAG_ID, id); map.put(TAG_DATA, data); reqEfetuadas.add(map); ListAdapter adapter = new SimpleAdapter(getActivity(), reqEfetuadas, R.layout.list_item_simple, new String[]{TAG_ID, TAG_DATA}, new int[]{R.id.pid, R.id.dataEscolhida}); setListAdapter(adapter); } } else { //pôr aqui toast } } } catch (JSONException e) { e.printStackTrace(); } } else { // Se o utilizador nao estiver conectado mostra Login Intent login = new Intent(getActivity(), Login.class); login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(login); } return rootView; } }
Any help please?
Thanks
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Error cannot be cast to android.app.Activity
client server connectivity problem
org.json.JSONException: No value for user
Accessing child TextView inside ListView
Issue so far is 2 days in that, i need reload fragment data after made refresh token using asynctask
More...