Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Course Queries Syllabus Queries 2 years ago
Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I am putting my data in spinners.Data is coming from URL.How to make spinner so that when syllabus is ICSE is chosen it reflect only those grade, subject which has ICSE?
My JSON
{ "results":[ { "syllabus":"CBSE", "grade":"5", "subject":"Kannada", "topic":"Grammar Level 1", "id":28 }, { "syllabus":"CBSE", "grade":"5", "subject":"Science", "topic":"The Natural Calamities", "id":16 }, { "syllabus":"CBSE", "grade":"6", "subject":"Science", "topic":"Movement in Animals", "id":116 }, { "syllabus":"CBSE", "grade":"6", "subject":"Social Studies", "topic":"Contact With Distant Lands", "id":59 }, { "syllabus":"CBSE", "grade":"6", "subject":"Social Studies", "topic":"Gupta Empire", "id":34 }, "id":148 }, { "syllabus":"ICSE", "grade":"6", "subject":"Computers", "topic":"Introduction to QBASIC Programming", "id":44 }, { "syllabus":"ICSE", "grade":"6", "subject":"Social Studies - History", "topic":"The Vedic Age", "id":42 }, { "syllabus":"Entrance Exam - Karnataka CET", "grade":"12", "subject":"Mathematics", "topic":"Previous Year Question Papers", "id":121 }, { "syllabus":"Entrance Exam - Karnataka CET", "grade":"12", "subject":"Science - Biology", "topic":"Previous Year Question Papers", "id":117 }, { "syllabus":"Entrance Exam - Karnataka CET", "grade":"12", "subject":"Science - Chemistry", "topic":"Previous Year Question Papers", "id":110 }, { "syllabus":"Entrance Exam - Karnataka CET", "grade":"12", "subject":"Science - Physics" REPLY 0 views 0 likes 0 shares Facebook Twitter Linked In WhatsApp
Remove these lines first from doInBackground method. No need to create separate arraylist here..
worldlist.add(jsonobject.optString("syllabus")); worldlist2.add(jsonobject.optString("grade")); worldlist3.add(jsonobject.optString("subject"));
Declare these arraylist globally...
ArrayList<String> syllabuslist; ArrayList<String> gradlist; ArrayList<String> subjectlist;
and initialize these spinner in OnCreate method before calling Async task(DownloadJSON())
Spinner mySpinner = (Spinner) findViewById(R.id.syllabus); Spinner mySpinner2 = (Spinner) findViewById(R.id.grade); Spinner mySpinner3 = (Spinner) findViewById(R.id.subject);
Now set spinner in onPostExecute() method....remove extra code you have written in onPostExcute...just copy my code
@Override protected void onPostExecute(Void args) { // Spinner adapter syllabuslist = new ArrayList<String>(); for (Results bean : world) { syllabuslist.add(bean.getSyllabus()); } ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, syllabuslist); adapter .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mySpinner.setAdapter(adapter); mySpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView> arg0, View arg1, int arg2, long arg3) { String syllabus_name = mySpinner.getItemAtPosition(arg2).toString(); gradlist = new ArrayList<String>(); for (int i = REPLY 0 views 0 likes 0 shares Facebook Twitter Linked In WhatsApp
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Course Queries 4 Answers
Course Queries 5 Answers
Course Queries 1 Answers
Course Queries 3 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.