SlideShare a Scribd company logo
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
Re:Kayo-System Co.,Ltd.

2011   10   22
Fragment fr = new MyFragment();
                 FragmentTransaction tr =
                      getSupportFragmentManager().beginTransaction();
                 tr.add(fr, "MyFragment");
                 tr.commit();




                                                           Re:Kayo-System Co.,Ltd.

2011   10   22
Re:Kayo-System Co.,Ltd.

2011   10   22
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
Re:Kayo-System Co.,Ltd.

2011   10   22
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
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
Re:Kayo-System Co.,Ltd.

2011   10   22
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
Re:Kayo-System Co.,Ltd.

2011   10   22
Re:Kayo-System Co.,Ltd.

2011   10   22
LoaderCallbacks<T>


                 Bundle bundle = new Bundle();
                 getSupportLoaderManager().initLoader(
                      R.layout.main, bundle, this);




                                                         Re:Kayo-System Co.,Ltd.

2011   10   22
Bundle bundle = new Bundle();
                 getSupportLoaderManager().restartLoader(
                      R.layout.main, bundle, this);




                                                      Re:Kayo-System Co.,Ltd.

2011   10   22
@Override
                 public void onDestroy() {
                     super.onDestroy();
                     getLoaderManager().destroyLoader(R.layout.main);
                 }




                                                          Re:Kayo-System Co.,Ltd.

2011   10   22
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
class ValueItem {
                     String name;
                     int age;
                 }




                                     Re:Kayo-System Co.,Ltd.

2011   10   22
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
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
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"
                         android:layout_height="match_parent"
                         … />




                                                       Re:Kayo-System Co.,Ltd.

2011   10   22
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
mViewPager.setAdapter(adapter);




                 mViewPager.setOnPageChangeListener(this);




                                                      Re:Kayo-System Co.,Ltd.

2011   10   22
Re:Kayo-System Co.,Ltd.

2011   10   22
Re:Kayo-System Co.,Ltd.

2011   10   22

More Related Content

ODP
Jersey Guice AOP
PDF
The Ring programming language version 1.5.1 book - Part 12 of 180
PDF
夜子まま塾講義3(androidで電卓アプリを作る)
PDF
EMFPath
PDF
Mobile Fest 2018. Александр Корин. Болеутоляющее
PDF
The Ring programming language version 1.7 book - Part 12 of 196
PDF
The Ring programming language version 1.5.2 book - Part 13 of 181
PDF
Current State of Coroutines
Jersey Guice AOP
The Ring programming language version 1.5.1 book - Part 12 of 180
夜子まま塾講義3(androidで電卓アプリを作る)
EMFPath
Mobile Fest 2018. Александр Корин. Болеутоляющее
The Ring programming language version 1.7 book - Part 12 of 196
The Ring programming language version 1.5.2 book - Part 13 of 181
Current State of Coroutines

What's hot (20)

PDF
Greach, GroovyFx Workshop
PDF
ZIP
Cleanup and new optimizations in WPython 1.1
PDF
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
PDF
Kotlin coroutine - the next step for RxJava developer?
PDF
Grails Transactions
PDF
The Ring programming language version 1.8 book - Part 90 of 202
PDF
Java 7 JUG Summer Camp
PDF
망고100 보드로 놀아보자 19
PDF
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
PDF
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
PPTX
Introduction to ParSeq: to make asynchronous java easier
PDF
Concurrency Concepts in Java
PDF
Conf soat tests_unitaires_Mockito_jUnit_170113
PDF
Actor Concurrency
PDF
NoSQL and JavaScript: a love story
PDF
RxJava и Android. Плюсы, минусы, подводные камни
PDF
Java Performance Puzzlers
PDF
Doc Parsers Api Cheatsheet 1 0
PDF
Vaadin 7
Greach, GroovyFx Workshop
Cleanup and new optimizations in WPython 1.1
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Kotlin coroutine - the next step for RxJava developer?
Grails Transactions
The Ring programming language version 1.8 book - Part 90 of 202
Java 7 JUG Summer Camp
망고100 보드로 놀아보자 19
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Introduction to ParSeq: to make asynchronous java easier
Concurrency Concepts in Java
Conf soat tests_unitaires_Mockito_jUnit_170113
Actor Concurrency
NoSQL and JavaScript: a love story
RxJava и Android. Плюсы, минусы, подводные камни
Java Performance Puzzlers
Doc Parsers Api Cheatsheet 1 0
Vaadin 7
Ad

Viewers also liked (8)

PDF
夜子まま塾講義11(暗黙的intent)
PDF
夜子まま塾講義2(javaのクラスとメソッド)
PDF
夜子まま塾講義8(androidの画面デザイン2)
PDF
関西Nfc lab勉強会 宣伝
PDF
夜子まま塾講義7(androidの画面デザイン1)
PDF
セーラーソン振り返り
PDF
関西支部Android勉強会(ロボットxnfc)
PPTX
Kobe.py 勉強会 minecraft piスライド
夜子まま塾講義11(暗黙的intent)
夜子まま塾講義2(javaのクラスとメソッド)
夜子まま塾講義8(androidの画面デザイン2)
関西Nfc lab勉強会 宣伝
夜子まま塾講義7(androidの画面デザイン1)
セーラーソン振り返り
関西支部Android勉強会(ロボットxnfc)
Kobe.py 勉強会 minecraft piスライド
Ad

More from Masafumi Terazono (20)

PDF
初心者向けSpigot開発
PPTX
Minecraft dayの報告
PPTX
BungeeCordeについて
PPTX
Spongeについて
PPTX
Minecraftと連携するSlackちゃんという会話Botを作った話
PDF
初心者〜中級者 Android StudioによるAndroid勉強会資料(スライド)
PDF
夜子まま塾 2015年1月23日 進行用資料
PDF
PDF
Android wear勉強会2
PDF
夜子まま塾@鹿児島
PDF
関西支部 第二回 NFCLab勉強会 
PDF
日本Androidの会 中国支部資料
PDF
Android+NFC 日本Androidの会神戸支部 勉強会
PDF
関西Unity勉強会
PDF
夜子まま塾講義12(broadcast reciever)
PDF
夜子まま塾講義10(画面の呼び出し)
PDF
夜子まま塾講義9(androidの画面デザイン)
PDF
夜子まま塾講義6(androidでhello world)
PDF
夜子まま塾講義5(実機を接続する)
PDF
夜子まま塾講義4(アプリを動かす)
初心者向けSpigot開発
Minecraft dayの報告
BungeeCordeについて
Spongeについて
Minecraftと連携するSlackちゃんという会話Botを作った話
初心者〜中級者 Android StudioによるAndroid勉強会資料(スライド)
夜子まま塾 2015年1月23日 進行用資料
Android wear勉強会2
夜子まま塾@鹿児島
関西支部 第二回 NFCLab勉強会 
日本Androidの会 中国支部資料
Android+NFC 日本Androidの会神戸支部 勉強会
関西Unity勉強会
夜子まま塾講義12(broadcast reciever)
夜子まま塾講義10(画面の呼び出し)
夜子まま塾講義9(androidの画面デザイン)
夜子まま塾講義6(androidでhello world)
夜子まま塾講義5(実機を接続する)
夜子まま塾講義4(アプリを動かす)

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Mushroom cultivation and it's methods.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
TLE Review Electricity (Electricity).pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
A comparative study of natural language inference in Swahili using monolingua...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cloud_computing_Infrastucture_as_cloud_p
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Heart disease approach using modified random forest and particle swarm optimi...
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Assigned Numbers - 2025 - Bluetooth® Document
Machine Learning_overview_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Mushroom cultivation and it's methods.pdf
1. Introduction to Computer Programming.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
TLE Review Electricity (Electricity).pptx

京都Gtugコンパチapi