Back to project page ProjectStudio.
The source code is released under:
Apache License
If you think the Android project ProjectStudio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package days_fragments; /*from w w w . ja v a2 s. c o m*/ import android.database.Cursor; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import com.example.uniutilproject.R; import java.sql.SQLException; import DB_Provider.TaskDataSource; import adapters.TaskCardAdapter; import model.Days; /** * Created by desmond on 1/21/14. */ public class TuesdayTaskFragment extends Fragment { private TaskDataSource dataSource; private ListView task_list; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.tuesday_taskview, container, false); //CALL DTABASE dataSource = new TaskDataSource(getActivity()); try { dataSource.open(); } catch (SQLException e) { e.printStackTrace(); } task_list = (ListView) view.findViewById(R.id.tuesday_task_listview); new android.os.Handler().post(new Runnable() { @Override public void run() { final Cursor cursor = dataSource.getTaskByDay(Days.Tuesday.toString()); /* if (cursor.moveToFirst()) { do { String dateString = cursor.getString(cursor.getColumnIndex(DB_ABSTRACTS.DBTasks.DAY_COLUMN)); if (dateString.contains("Mon")) { Log.e("includes", " contains " + dateString); } } while (cursor.moveToNext()); } */ TaskCardAdapter adapter = new TaskCardAdapter(getActivity(), cursor, true); task_list.setAdapter(adapter); adapter.notifyDataSetChanged(); } }); dataSource.close(); return view; } @Override public void onResume() { try { dataSource.open(); } catch (SQLException e) { e.printStackTrace(); } super.onResume(); } @Override public void onPause() { dataSource.close(); super.onPause(); } }