{"id":262,"date":"2010-11-11T23:58:57","date_gmt":"2010-11-11T14:58:57","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2010\/11\/11\/android_tabactivity\/"},"modified":"2010-11-11T23:58:57","modified_gmt":"2010-11-11T14:58:57","slug":"android_tabactivity","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2010\/11\/11\/android_tabactivity\/","title":{"rendered":"Android TabActivity \u3092\u5229\u7528\u3059\u308b\u30b5\u30f3\u30d7\u30eb"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>TabActivity \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30b9\u30b1\u30eb\u30c8\u30f3\u3002<\/p>\n<pre class=\"prettyprint linenums\">package info.typea.kakeibot;\r\n\r\nimport android.app.TabActivity;\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.view.LayoutInflater;\r\nimport android.view.View;\r\nimport android.widget.TabHost;\r\nimport android.widget.TextView;\r\n\r\npublic class KakeibotActivity extends TabActivity  implements TabHost.TabContentFactory{\r\n    \r\n    \/** Called when the activity is first created. *\/\r\n    @Override\r\n    public void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n\r\n        final TabHost tabhost = getTabHost();\r\n        \r\n\t\/\/ \u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3(CategoryPickupActivity) \u3092\u30bf\u30d6\u306b\u30db\u30b9\u30c8\u3059\u308b\r\n        tabhost.addTab(tabhost.newTabSpec(\"tab1\")\r\n                .setIndicator(\"categories\", getResources().getDrawable(android.R.drawable.ic_menu_add))\r\n                .setContent(new Intent(this, CategoryPickupActivity.class)\r\n                .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));\r\n        \r\n        \/\/ \u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3(RegisterdItemPickupActivity)\u3092\u30bf\u30d6\u306b\u30db\u30b9\u30c8\u3059\u308b\r\n        tabhost.addTab(tabhost.newTabSpec(\"tab2\")\r\n                .setIndicator(\"items\", getResources().getDrawable(android.R.drawable.ic_menu_delete))\r\n                .setContent(new Intent(this, RegisterdItemPickupActivity.class)\r\n                .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));\r\n\r\n\t\/\/ \u3053\u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u81ea\u4f53\u3092\u30db\u30b9\u30c8\u3059\u308b(createTabContent \u304c\u8fd4\u3059 View \u304c\u8868\u793a\u3055\u308c\u308b)\r\n        tabhost.addTab(tabhost.newTabSpec(\"tab3\")\r\n                .setIndicator(\"upload\", getResources().getDrawable(android.R.drawable.ic_menu_upload))\r\n                .setContent(this));\r\n    }\r\n\r\n    @Override\r\n    public View createTabContent(String tag) {\r\n        final TextView tv = new TextView(this);\r\n        tv.setText(\"Content for tab with tag \" + tag);\r\n        return tv;\r\n    }\r\n}<\/pre>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/b47a6fb3f867_148E8\/tabactivity.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px\" title=\"tabactivity\" border=\"0\" alt=\"tabactivity\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/b47a6fb3f867_148E8\/tabactivity_thumb.png\" width=\"180\" height=\"298\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; TabActivity \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306e\u30b9\u30b1\u30eb\u30c8\u30f3\u3002 package info.typea.kakeibot; import android.app.TabActivity; import android. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[39],"tags":[],"class_list":["post-262","post","type-post","status-publish","format-standard","hentry","category-android"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}