Now Loading. Please Wait ...                  GTUG Android        Android                  Android3.0                     ...
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Fragment fr = new MyFragment();                 FragmentTransaction tr =                      getSupportFragmentManager()....
Re:Kayo-System Co.,Ltd.2011   10   22
public Fragment createFragment(int n){                     MyFragment f = new MyFragment();                     Bundle bun...
Re:Kayo-System Co.,Ltd.2011   10   22
Fragment fr = new MyFragment(n++);                 FragmentTransaction tr =                      getSupportFragmentManager...
Fragment f =                    getSupportFragmentManager().                       findFragmentByTag("tag");              ...
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
class MyAsyncTask extends AsyncTask<Void, Void, Void>{                     Handler handler;                     Context co...
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
LoaderCallbacks<T>                 Bundle bundle = new Bundle();                 getSupportLoaderManager().initLoader(    ...
Bundle bundle = new Bundle();                 getSupportLoaderManager().restartLoader(                      R.layout.main,...
@Override                 public void onDestroy() {                     super.onDestroy();                     getLoaderMa...
LoaderCallbacks<T>                 public static class MyLoaderFragment extends Fragment implements                 Loader...
class ValueItem {                     String name;                     int age;                 }                         ...
public static class MyLoaderFragment2 extends Fragment implements                 LoaderCallbacks<List<ValueItem>>{       ...
static class MyAsyncTaskLoader extends AsyncTaskLoader<List<ValueItem>>{                       public MyAsyncTaskLoader(Co...
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
 <android.support.v4.view.ViewPager                         android:layout_width="match_parent"                         an...
public         static class MyAdapter extends FragmentPagerAdapter {                                 public MyAdapter(Frag...
mViewPager.setAdapter(adapter);                 mViewPager.setOnPageChangeListener(this);                                 ...
Re:Kayo-System Co.,Ltd.2011   10   22
Re:Kayo-System Co.,Ltd.2011   10   22
Upcoming SlideShare
Loading in …5
×

京都Gtugコンパチapi

2,421 views

Published on

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,421
On SlideShare
0
From Embeds
0
Number of Embeds
48
Actions
Shares
0
Downloads
14
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

京都Gtugコンパチapi

  1. 1. Now Loading. Please Wait ... GTUG Android Android Android3.0 Re:Kayo-System Co.,Ltd.2011 10 22
  2. 2. Re:Kayo-System Co.,Ltd.2011 10 22
  3. 3. Re:Kayo-System Co.,Ltd.2011 10 22
  4. 4. Re:Kayo-System Co.,Ltd.2011 10 22
  5. 5. Re:Kayo-System Co.,Ltd.2011 10 22
  6. 6. Re:Kayo-System Co.,Ltd.2011 10 22
  7. 7. Re:Kayo-System Co.,Ltd.2011 10 22
  8. 8. Re:Kayo-System Co.,Ltd.2011 10 22
  9. 9. Re:Kayo-System Co.,Ltd.2011 10 22
  10. 10. Re:Kayo-System Co.,Ltd.2011 10 22
  11. 11. Re:Kayo-System Co.,Ltd.2011 10 22
  12. 12. Re:Kayo-System Co.,Ltd.2011 10 22
  13. 13. Re:Kayo-System Co.,Ltd.2011 10 22
  14. 14. Fragment fr = new MyFragment(); FragmentTransaction tr = getSupportFragmentManager().beginTransaction(); tr.add(fr, "MyFragment"); tr.commit(); Re:Kayo-System Co.,Ltd.2011 10 22
  15. 15. Re:Kayo-System Co.,Ltd.2011 10 22
  16. 16. public Fragment createFragment(int n){ MyFragment f = new MyFragment(); Bundle bundle = new Bundle(); bundle.putInt("num", n); f.setArguments(bundle); return f; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if(savedInstanceState!=null){ n = savedInstanceState.getInt("num"); } else{ Bundle bundle = getArguments(); if(bundle!=null){ n = bundle.getInt("num"); } } } Re:Kayo-System Co.,Ltd.2011 10 22
  17. 17. Re:Kayo-System Co.,Ltd.2011 10 22
  18. 18. Fragment fr = new MyFragment(n++); FragmentTransaction tr = getSupportFragmentManager().beginTransaction(); tr.replace(R.id.frameLayout1, fr); tr.addToBackStack("task"); tr.commit(); Re:Kayo-System Co.,Ltd.2011 10 22
  19. 19. Fragment f = getSupportFragmentManager(). findFragmentByTag("tag"); Re:Kayo-System Co.,Ltd.2011 10 22
  20. 20. Re:Kayo-System Co.,Ltd.2011 10 22
  21. 21. Re:Kayo-System Co.,Ltd.2011 10 22
  22. 22. Re:Kayo-System Co.,Ltd.2011 10 22
  23. 23. Re:Kayo-System Co.,Ltd.2011 10 22
  24. 24. class MyAsyncTask extends AsyncTask<Void, Void, Void>{ Handler handler; Context context; @Override protected Void doInBackground(Void... params) { Cursor cur = context.getContentResolver().query( Media.EXTERNAL_CONTENT_URI, null, null, null, null); handler.sendMessage(handler.obtainMessage(0, cur)); return null; } } Re:Kayo-System Co.,Ltd.2011 10 22
  25. 25. Re:Kayo-System Co.,Ltd.2011 10 22
  26. 26. Re:Kayo-System Co.,Ltd.2011 10 22
  27. 27. LoaderCallbacks<T> Bundle bundle = new Bundle(); getSupportLoaderManager().initLoader( R.layout.main, bundle, this); Re:Kayo-System Co.,Ltd.2011 10 22
  28. 28. Bundle bundle = new Bundle(); getSupportLoaderManager().restartLoader( R.layout.main, bundle, this); Re:Kayo-System Co.,Ltd.2011 10 22
  29. 29. @Override public void onDestroy() { super.onDestroy(); getLoaderManager().destroyLoader(R.layout.main); } Re:Kayo-System Co.,Ltd.2011 10 22
  30. 30. LoaderCallbacks<T> public static class MyLoaderFragment extends Fragment implements LoaderCallbacks<Cursor>{ CursorAdapter adapter; public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) { return new CursorLoader(getActivity(), Media.EXTERNAL_CONTENT_URI, null, null, null, null); } public void onLoadFinished(Loader<Cursor> arg0, Cursor arg1) { Cursor cur = adapter.swapCursor(arg1); } public void onLoaderReset(Loader<Cursor> arg0) { } } Re:Kayo-System Co.,Ltd.2011 10 22
  31. 31. class ValueItem { String name; int age; } Re:Kayo-System Co.,Ltd.2011 10 22
  32. 32. public static class MyLoaderFragment2 extends Fragment implements LoaderCallbacks<List<ValueItem>>{ public Loader<List<ValueItem>> onCreateLoader(int arg0, Bundle arg1) { // TODO Auto-generated method stub return null; } public void onLoadFinished(Loader<List<ValueItem>> arg0, List<ValueItem> arg1) { // TODO Auto-generated method stub } public void onLoaderReset(Loader<List<ValueItem>> arg0) { // TODO Auto-generated method stub } } Re:Kayo-System Co.,Ltd.2011 10 22
  33. 33. static class MyAsyncTaskLoader extends AsyncTaskLoader<List<ValueItem>>{ public MyAsyncTaskLoader(Context context) { super(context); } @Override public List<ValueItem> loadInBackground() { List<ValueItem> list = new ArrayList<ValueItem>(); return list; } } public Loader<List<ValueItem>> onCreateLoader(int arg0, Bundle arg1) { MyAsyncTaskLoader l = new MyAsyncTaskLoader(getActivity()); l.forceLoad(); return l; } Re:Kayo-System Co.,Ltd.2011 10 22
  34. 34. Re:Kayo-System Co.,Ltd.2011 10 22
  35. 35. Re:Kayo-System Co.,Ltd.2011 10 22
  36. 36. Re:Kayo-System Co.,Ltd.2011 10 22
  37. 37. Re:Kayo-System Co.,Ltd.2011 10 22
  38. 38.  <android.support.v4.view.ViewPager         android:layout_width="match_parent"         android:layout_height="match_parent"         … /> Re:Kayo-System Co.,Ltd.2011 10 22
  39. 39. public static class MyAdapter extends FragmentPagerAdapter {         public MyAdapter(FragmentManager fm) {             super(fm);         }         @Override         public int getCount() {             return NUM_ITEMS;         }         @Override         public Fragment getItem(int position) {             return ArrayListFragment.newInstance(position);         }     } Re:Kayo-System Co.,Ltd.2011 10 22
  40. 40. mViewPager.setAdapter(adapter); mViewPager.setOnPageChangeListener(this); Re:Kayo-System Co.,Ltd.2011 10 22
  41. 41. Re:Kayo-System Co.,Ltd.2011 10 22
  42. 42. Re:Kayo-System Co.,Ltd.2011 10 22

×