コード例 #1
0
        public override void onCreate(Bundle savedInstanceState)
        {
            if (Build.VERSION.SDK_INT == Build.VERSION_CODES.HONEYCOMB || Build.VERSION.SDK_INT == Build.VERSION_CODES.HONEYCOMB_MR1)
            {
                StrictMode.ThreadPolicy = (new StrictMode.ThreadPolicy.Builder()).detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build();
                StrictMode.VmPolicy     = (new StrictMode.VmPolicy.Builder()).detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build();
            }
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_main;

            List <Dictionary <string, string> > data = new List <Dictionary <string, string> >();

            for (int i = 0; i < FUNCTIONS.Length; i++)
            {
                Dictionary <string, string> hashMap = new Dictionary <string, string>();
                hashMap["item1"] = FUNCTIONS[i][0];
                hashMap["item2"] = FUNCTIONS[i][1];
                data.Add(hashMap);
            }

            SimpleAdapter adapter = new SimpleAdapter(this, data, android.R.layout.simple_list_item_2, new string[] { "item1", "item2" }, new int[] { android.R.id.text1, android.R.id.text2 });

            mListView         = (ListView)findViewById(android.R.id.list);
            mListView.Adapter = adapter;
            mListView.Enabled = false;

            mProgressBar = (ProgressBar)findViewById(R.id.progressBar1);

            mBixolonPrinter = new BixolonPrinter(this, mHandler, null);
        }
コード例 #2
0
		public override void onCreate(Bundle savedInstanceState)
		{
			if (Build.VERSION.SDK_INT == Build.VERSION_CODES.HONEYCOMB || Build.VERSION.SDK_INT == Build.VERSION_CODES.HONEYCOMB_MR1)
			{
				StrictMode.ThreadPolicy = (new StrictMode.ThreadPolicy.Builder()).detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build();
				StrictMode.VmPolicy = (new StrictMode.VmPolicy.Builder()).detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().penaltyDeath().build();
			}
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_main;

			List<Dictionary<string, string>> data = new List<Dictionary<string, string>>();
			for (int i = 0; i < FUNCTIONS.Length; i++)
			{
				Dictionary<string, string> hashMap = new Dictionary<string, string>();
				hashMap["item1"] = FUNCTIONS[i][0];
				hashMap["item2"] = FUNCTIONS[i][1];
				data.Add(hashMap);
			}

			SimpleAdapter adapter = new SimpleAdapter(this, data, android.R.layout.simple_list_item_2, new string[] {"item1", "item2"}, new int[] {android.R.id.text1, android.R.id.text2});
			mListView = (ListView) findViewById(android.R.id.list);
			mListView.Adapter = adapter;
			mListView.Enabled = false;

			mProgressBar = (ProgressBar) findViewById(R.id.progressBar1);

			mBixolonPrinter = new BixolonPrinter(this, mHandler, null);
		}