{"id":61,"date":"2016-02-02T00:00:12","date_gmt":"2016-02-01T15:00:12","guid":{"rendered":"http:\/\/www.hundredapps.net\/?p=61"},"modified":"2018-03-02T23:22:30","modified_gmt":"2018-03-02T14:22:30","slug":"%e3%82%b7%e3%83%b3%e3%83%97%e3%83%ab%e3%81%aa%e3%83%a1%e3%83%a2%e5%b8%b3%e3%82%a2%e3%83%97%e3%83%aa%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8d%e3%81%86%e5%85%a5%e9%96%80%e7%b7%a8%e6%9c%80%e7%b5%82%e5%9b%9e","status":"publish","type":"post","link":"https:\/\/www.hundredapps.net\/?p=61","title":{"rendered":"\u30b7\u30f3\u30d7\u30eb\u306a\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3092\u3064\u304f\u308d\u3046(\u5165\u9580\u7de8\u6700\u7d42\u56de )"},"content":{"rendered":"<p>\u5165\u9580\u7de8\u306e\u6700\u7d42\u56de\u3068\u3057\u3066\u3001\u4eca\u307e\u3067\u89e3\u8aac\u3057\u3066\u304d\u305f\u5404\u7ae0\u3067\u7d39\u4ecb\u3057\u305f\u6a5f\u80fd\u3092\u53d6\u308a\u5165\u308c\u305f\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3092\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u308f\u304b\u3089\u306a\u3044\u3053\u3068\u304c\u3042\u308c\u3070\u3001\u5404\u7ae0\u3092\u898b\u8fd4\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30e1\u30e2\u30a2\u30d7\u30ea\u306e\u4ed5\u69d8\u8aac\u660e<\/h2>\n<p>\u753b\u9762\u306f\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3067\u63b2\u8f09\u3057\u3066\u3044\u308b\uff12\u753b\u9762\u69cb\u6210\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/> \u5404\u7ae0\u3067\u8aac\u660e\u3057\u3066\u304d\u305f\u300cActivity\u300d\u300cIntent\u300d\u300cLayout(UI)\u300d\u300cSqlite\u300d\u300cActionBar\u300d\u3092\u5b66\u3093\u3067\u3044\u308c\u3070\u3001<br \/> \u30b7\u30f3\u30d7\u30eb\u306a\u3064\u304f\u308a\u306a\u306e\u3067\u3059\u3050\u7406\u89e3\u51fa\u6765\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30a2\u30d7\u30ea\u5b8c\u6210\u5f62\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8<\/h3>\n<p>\u30e1\u30e2\u5e33\u306e\u30ea\u30b9\u30c8\u753b\u9762<br \/> <br \/>\n<a href=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_list.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_list-172x300.png\" alt=\"memo_list\" width=\"172\" height=\"300\" class=\"alignnone size-medium wp-image-74\" srcset=\"https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_list-172x300.png 172w, https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_list.png 418w\" sizes=\"auto, (max-width: 172px) 100vw, 172px\" \/><\/a><\/p>\n<p>\u30e1\u30e2\u5e33\u306e\u7de8\u96c6\u753b\u9762<br \/>\n<a href=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_edit.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_edit-168x300.png\" alt=\"memo_edit\" width=\"168\" height=\"300\" class=\"alignnone size-medium wp-image-73\" srcset=\"https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_edit-168x300.png 168w, https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_edit.png 408w\" sizes=\"auto, (max-width: 168px) 100vw, 168px\" \/><\/a><\/p>\n<p>\u30e1\u30e2\u5e33\u306e\u691c\u7d22\u753b\u9762<br \/>\n<a href=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_search.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_search-171x300.png\" alt=\"memo_search\" width=\"171\" height=\"300\" class=\"alignnone size-medium wp-image-75\" srcset=\"https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_search-171x300.png 171w, https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/02\/memo_search.png 406w\" sizes=\"auto, (max-width: 171px) 100vw, 171px\" \/><\/a><\/p>\n<hr style=\"clear: both; margin-bottom: 50px;\" \/>\n<h2>Android Studio SampleMemo\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u6210<\/h2>\n<a href=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.15.45.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.15.45-193x300.png\" alt=\"Screen-Shot-2014-08-31-at-23.15.45\" width=\"193\" height=\"300\" class=\"alignnone size-medium wp-image-27\" srcset=\"https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.15.45-193x300.png 193w, https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.15.45.png 336w\" sizes=\"auto, (max-width: 193px) 100vw, 193px\" \/><\/a>\n<a href=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.12.08.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.12.08-175x300.png\" alt=\"Screen-Shot-2014-08-31-at-23.12.08\" width=\"175\" height=\"300\" class=\"alignnone size-medium wp-image-26\" srcset=\"https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.12.08-175x300.png 175w, https:\/\/www.hundredapps.net\/wp-content\/uploads\/2016\/01\/Screen-Shot-2014-08-31-at-23.12.08.png 328w\" sizes=\"auto, (max-width: 175px) 100vw, 175px\" \/><\/a>\n<p style=\"clear: both;\">\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3067\u95a2\u9023\u3057\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u57fa\u672c\u7684\u306b\u3001java\u3001res\u306e\u30d5\u30a9\u30eb\u30c0\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u53ca\u3073AndroidManifest.xml\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u95a2\u9023\u30d5\u30a1\u30a4\u30eb<\/h3>\n<table style=\"height: 232px;\" width=\"339\">\n<tbody>\n<tr>\n<td>\u30d7\u30ed\u30b0\u30e9\u30e0\u30d5\u30a1\u30a4\u30eb<\/td>\n<td>\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>MemoListActivity.java<\/td>\n<td>\u30ea\u30b9\u30c8\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>MemoEditActivity.java<\/td>\n<td>\u7de8\u96c6\u753b\u9762<\/td>\n<\/tr>\n<tr>\n<td>MemoAdapter.java<\/td>\n<td>\u30ea\u30b9\u30c8\u753b\u9762\u3068\u306e\u6a4b\u6e21\u3057\u306e\u5f79\u5272<\/td>\n<\/tr>\n<tr>\n<td>MemoDao.java<\/td>\n<td>memo\u30c6\u30fc\u30d6\u30eb\u306eData Access Object<\/td>\n<\/tr>\n<tr>\n<td>DatabaseHelper.java<\/td>\n<td><span style=\"color: #444444;\">SQLiteOpenHelper\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\u30af\u30e9\u30b9<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table style=\"height: 232px;\" width=\"339\">\n<tbody>\n<tr>\n<td>\u30ea\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb<\/td>\n<td>\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td>angular_circle_corner.xml<\/td>\n<td>\u7de8\u96c6\u753b\u9762\u306e\u80cc\u666f\u3092\u89d2\u4e38\u306b\u3057\u3066\u3044\u308b<\/td>\n<\/tr>\n<tr>\n<td>activity_memo_list.xml<\/td>\n<td>\u30ea\u30b9\u30c8\u753b\u9762\u306e\u30ec\u30a4\u30a2\u30a6\u30c8<\/td>\n<\/tr>\n<tr>\n<td>activity_memo_list_row.xml<\/td>\n<td>\u30ea\u30b9\u30c8\u753b\u9762\u306e\u30e1\u30e2\u3001\u65e5\u4ed8\u3001\u30e1\u30e2ID\u306eView<\/td>\n<\/tr>\n<tr>\n<td>activity_memo_edit.xml<\/td>\n<td>\u7de8\u96c6\u753b\u9762\u306e\u30ec\u30a4\u30a2\u30a6\u30c8<\/td>\n<\/tr>\n<tr>\n<td>memo_list.xml<\/td>\n<td>\u30ea\u30b9\u30c8\u753b\u9762\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u30d0\u30fc\u306e\u30e1\u30cb\u30e5\u30fc\u30dc\u30bf\u30f3<\/td>\n<\/tr>\n<tr>\n<td>memo_edit.xml<\/td>\n<td><span style=\"color: #444444;\">\u7de8\u96c6\u753b\u9762\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u30d0\u30fc\u306e\u30e1\u30cb\u30e5\u30fc\u30dc\u30bf\u30f3<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div>\u305d\u308c\u3067\u306f\u3001\u4e00\u756a\u306f\u3058\u3081\u306b\u8d77\u52d5\u3057\u305f\u6642\u306b\u8868\u793a\u3055\u308c\u308b\u30ea\u30b9\u30c8\u753b\u9762\u304b\u3089<br \/> \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u30d9\u30fc\u30b9\u3067\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/div>\n<h2>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u8aac\u660e<\/h2>\n<h3>\u30ea\u30b9\u30c8\u753b\u9762\u306e\u89e3\u8aac<\/h3>\n<pre class=\"lang:java decode:true \">\/**\n * \u4fdd\u5b58\u3057\u305f\u30e1\u30e2\u306e\u4e00\u89a7\n *\/\npublic class MemoListActivity extends Activity {\n\n    private static final String TAG = \"MemoListActivity\";\n    private String mSearchWord = null;\n    private ListView listView;\n\n    \/**\n    \u30ec\u30a4\u30a2\u30a6\u30c8\u306e\u30bb\u30c3\u30c8\u53ca\u3073listView\u5909\u6570\u3078\u306e\u683c\u7d0d\u306e\u307f\u306b\u306a\u308a\u307e\u3059\u3002\n    MemoEditActivity\u304b\u3089\u623b\u3063\u3066\u304d\u305f\u5834\u5408\u3001onCreate\u30e1\u30bd\u30c3\u30c9\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044\u70ba\u3001\n    onResume\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u57fa\u672c\u7684\u306a\u51e6\u7406\u3092\u8a18\u8f09\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002\n            \u203b onCreate\u306f1\u5ea6\u5b9f\u884c\u3055\u308c\u308b\u3068\u3001\uff12\u5ea6\u76ee\u306e\u5b9f\u884c\u306f\u3055\u308c\u307e\u305b\u3093\u3002\n     *\/\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_memo_list);\n\n        \/\/ XML\u3067\u5b9a\u7fa9\u3057\u305fListView\u3092\u53d6\u5f97\u3059\u308b\n        listView = (ListView) findViewById(R.id.ListView01);\n    }\n\n    \/**\n    \u3053\u306e\u30af\u30e9\u30b9\u5185\u306esetDatabaseDataBySearchWord\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u3001\n    \u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u5024\u3092\u53d6\u5f97\u3057ListView\u306b\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\n     *\/\n    @Override\n    protected void onResume() {\n        super.onResume();\n\n        setDatabaseDataBySearchWord(mSearchWord);\n    }\n\n    \/**\n     \u30aa\u30d7\u30b7\u30e7\u30f3\u30e1\u30cb\u30e5\u30fc\u306e\u4f5c\u6210\u51e6\u7406\u306b\u306a\u308a\u307e\u3059\u3002\n     *\/\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.memo_list, menu);\n\n        \/\/ SearchView\u306e\u4f5c\u6210\n        SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n        SearchView searchView = (SearchView) menu.findItem(R.id.actionbar_search).getActionView();\n        searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n\n        \/\/ \u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u51e6\u7406\n        SearchView.OnQueryTextListener queryTextListener = new SearchView.OnQueryTextListener() {\n\n            \/\/ \u691c\u7d22\u7a93\u304b\u3089\u6587\u5b57\u304c\u5165\u529b\u3055\u308c\u308b\u5ea6\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\n            @Override\n            public boolean onQueryTextChange(String searchWord) {\n                setDatabaseDataBySearchWord(searchWord);\n                mSearchWord = searchWord;\n                return true;\n            }\n\n            \/\/ \u691c\u7d22\u30dc\u30bf\u30f3\u3082\u3057\u304f\u306f\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u3067Enter\u3055\u308c\u305f\u969b\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\n            @Override\n            public boolean onQueryTextSubmit(String searchWord) {\n                return true;\n            }\n        };\n\n        \/\/ \u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3092\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002\n        searchView.setOnQueryTextListener(queryTextListener);\n\n        return super.onCreateOptionsMenu(menu);\n    }\n\n    \/**\n     \u30e1\u30cb\u30e5\u30fc\u306e\u30a2\u30a4\u30c6\u30e0\u304c\u9078\u629e\u3055\u308c\u305f\u969b\u306e\u51e6\u7406\u3067\u3059\u3002\n     \u65b0\u898f\u30dc\u30bf\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u3066\u3044\u308c\u3070\u3001MemoEditActivity\u3078\u9077\u79fb\u3057\u307e\u3059\u3002\n     *\/\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        int id = item.getItemId();\n\n        \/\/ \u65b0\u898f\u30dc\u30bf\u30f3\u8ffd\u52a0\u30dc\u30bf\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u51e6\u7406\n        if (id == R.id.actionbar_add) {\n            Intent intent = new Intent();\n            intent.setClassName(this, \"net.hundredapps.samplememo.MemoEditActivity\");\n            startActivity(intent);\n            return true;\n\n        }\n\n        \/\/ \u691c\u7d22\u30dc\u30bf\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u51e6\u7406\n        if (id == R.id.actionbar_search) {\n            return true;\n        }\n        return super.onOptionsItemSelected(item);\n    }\n\n    \/**\n    \u3053\u306eActivity\u5185\u3067\u306e\u4e00\u756a\u5927\u4e8b\u306a\u691c\u7d22\u51e6\u7406\u306b\u306a\u308a\u307e\u3059\u3002\n     *\/\n    private void setDatabaseDataBySearchWord(String searchWord) {\n\n        ArrayList<HashMap<String, Object>> memoLists;\n        MemoDao dao = new MemoDao(getApplicationContext());\n        dao.connection();\n\n        if (TextUtils.isEmpty(searchWord)) {\n            memoLists = dao.searchAll();\n        } else {\n            memoLists = dao.searchAllByWord(searchWord);\n        }\n        dao.close();\n\n        setListView(memoLists);\n    }\n\n    \/**\n     \u30a2\u30c0\u30d7\u30bf\u3092\u4ecb\u3057\u3066\u3001\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc\u306b\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\n     *\/\n    private void setListView(ArrayList<HashMap<String, Object>> memoLists) {\n\n        MemoListAdapter memoListAdapter = new MemoListAdapter(getApplicationContext());\n        memoListAdapter.setMemoLists(memoLists);\n        listView.setAdapter(memoListAdapter);\n        listView.setOnItemClickListener(new ClickEventOnMemoActivity());\n        \/\/listView.setTextFilterEnabled(true);\n    }\n\n    \/**\n     \u30ea\u30b9\u30c8\u3067\u30e1\u30e2\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u969b\u306e\u51e6\u7406(\u5f8c\u3005\u3001\u30d5\u30a1\u30a4\u30eb\u5206\u5272\u3057\u3084\u3059\u3044\u3088\u3046\u306b\u5185\u90e8\u30af\u30e9\u30b9\u3068\u3057\u3066\u8a18\u8ff0)\u306b\u306a\u308a\u307e\u3059\u3002\n     \u30a4\u30f3\u30c6\u30f3\u30c8\u3092\u751f\u6210\u3057\u3001\u30e1\u30e2ID\u3092\u30bb\u30c3\u30c8\u5f8c\u3001MemoEditActivity\u3078\u9077\u79fb\u3057\u307e\u3059\u3002\n     (\u3053\u306e\u30a4\u30d9\u30f3\u30c8\u30ea\u30b9\u30ca\u30fc\u3067\u3042\u308b\u5185\u90e8\u30af\u30e9\u30b9\u306f\u3001\u4e0a\u8a18\u306esetListView\u30e1\u30bd\u30c3\u30c9\u3067\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002)\n     *\/\n    class ClickEventOnMemoActivity implements AdapterView.OnItemClickListener {\n\n        @Override\n        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n            TextView idView = (TextView)view.findViewById(R.id.id);\n\n            Intent intent = new Intent();\n            intent.setClassName(getApplicationContext(), \"net.hundredapps.samplememo.MemoEditActivity\");\n            intent.putExtra(\"memo_id\", idView.getText().toString());\n            startActivity(intent);\n        }\n    }\n\n}\n<\/pre>\n<p>\u4ee5\u4e0a\u304c\u3001\u30ea\u30b9\u30c8\u753b\u9762\u306e\u89e3\u8aac\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u7de8\u96c6\u753b\u9762\u306e\u89e3\u8aac<\/h3>\n<pre class=\"lang:java decode:true \">\/**\n * \u7de8\u96c6\u753b\u9762\n *\/\npublic class MemoEditActivity extends Activity {\n\n    private MemoDao dao = null;\n\n    \/**\n     \u30e1\u30e2ID\u3092\u53d6\u5f97\u3057\u3001\u8a72\u5f53\u3059\u308b\u30e1\u30e2\u5185\u5bb9\u3092\u30c7\u30fc\u30bf\u30fc\u30d9\u30fc\u30b9\u304b\u3089\u8a72\u5f53\u3059\u308b\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002\n     \u30e1\u30e2\u5185\u5bb9\u3092\u53d6\u5f97\u5f8c\u3001EditText\u306eView\u306b\u30c7\u30fc\u30bf\u3092\u30bb\u30c3\u30c8\u3057\u3066\u8868\u793a\u3055\u305b\u3066\u3044\u307e\u3059\u3002\n     \u53c8\u3001\u30e1\u30e2ID\u304c\u53d6\u5f97\u51fa\u6765\u306a\u304b\u3063\u305f\u3089\u3001\u65b0\u898f\u30e1\u30e2\u306e\u4f5c\u6210\u3068\u898b\u306a\u3057\u3001\u305d\u306e\u307e\u307eEditView\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002\n     *\/\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_memo_edit);\n\n        \/\/ \u30a2\u30af\u30b7\u30e7\u30f3\u30d0\u30fc\u306e\u623b\u308b\u3092\u8a2d\u5b9a\n        getActionBar().setDisplayHomeAsUpEnabled(true);\n\n        \/\/ \u30a4\u30f3\u30c6\u30f3\u30c8\u306e\u53d6\u5f97\n        Intent data = getIntent();\n        if (data != null) {\n\n            \/\/ memoId\u3092\u53d6\u5f97\n            String memoId = data.getStringExtra(\"memo_id\");\n            if (memoId != null) {\n\n                \/\/ TextView\u3092\u53d6\u5f97\u3057\u3001\u30e1\u30e2ID\u3092\u30bb\u30c3\u30c8\n                TextView textView = (TextView) findViewById(R.id.memo_id);\n                textView.setText(memoId);\n\n                \/\/ \u30c7\u30fc\u30bf\u691c\u7d22\n                MemoDao memoDao = new MemoDao(getApplicationContext());\n                memoDao.connection();\n                HashMap memoMap = memoDao.searchById(memoId);\n                memoDao.close();\n\n                \/\/ EditText\u306eView\u306b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\n                EditText editText = (EditText) findViewById(R.id.edittext01);\n                editText.setText(memoMap.get(\"content\").toString());\n\n            }\n\n        }\n\n    }\n\n    \/**\n     \u66f4\u65b0\u3068\u524a\u9664\u306e\u30e1\u30cb\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\n     \/app\/src\/main\/res\/menu\/memo_edit.xml\u53c2\u7167\n     *\/\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.memo_edit, menu);\n        return true;\n    }\n\n    \/**\n     \u30a2\u30af\u30b7\u30e7\u30f3\u30d0\u30fc\u306e\u66f4\u65b0\u30dc\u30bf\u30f3\u3068\u524a\u9664\u30dc\u30bf\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u51e6\u7406\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n     \u307e\u305a\u3001\u66f4\u65b0\u30dc\u30bf\u30f3\u3067\u3059\u304c\u3001\u30e1\u30e2\u5185\u5bb9\u304c\u5165\u308bEditView\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u30e1\u30e2\u5185\u5bb9\u304c\u306a\u3051\u308c\u3070\u3001\n     \u4f55\u3082\u3057\u307e\u305b\u3093\u3002\u30e1\u30e2\u5185\u5bb9\u304c\u3042\u308c\u3070\u3001\u66f4\u306b\u3001TextView\u306bmemo_id\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002\n     \u5b58\u5728\u3057\u3066\u3044\u308c\u3070\u3001\u524d\u306e\u753b\u9762\u3067\u30ea\u30b9\u30c8\u3092\u30bf\u30c3\u30d7\u3057\u3066\u304d\u305f\u72b6\u614b(\u7de8\u96c6\u30e2\u30fc\u30c9)\u3068\u306a\u308b\u306e\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\n     \u66f4\u65b0\u3057\u307e\u3059\u3002\u306a\u3051\u308c\u3070\u3001\u65b0\u898f\u306b\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u3068\u306a\u308a\u307e\u3059\u3002\n     *\/\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        int id = item.getItemId();\n\n        \/\/ \u4fdd\u5b58\u30dc\u30bf\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u51e6\u7406\n        if (id == R.id.actionbar_save) {\n\n            \/\/ EditText\u306eView\u304b\u3089\u5165\u529b\u5185\u5bb9\u3092\u53d6\u5f97\n            EditText edit = (EditText)findViewById(R.id.edittext01);\n            String content = edit.getText().toString();\n            if (content == null) return false;\n\n            \/\/ TextView\u3092\u53d6\u5f97\u3057\u3001\u30e1\u30e2ID\u3092\u53d6\u5f97\n            TextView textView = (TextView)findViewById(R.id.memo_id);\n            String memoId = textView.getText().toString();\n\n\n            MemoDao memoDao = new MemoDao(getApplicationContext());\n            memoDao.connection();\n\n            if (memoId == null || memoId.length() == 0) {\n                \/\/ \u30c7\u30fc\u30bf\u65b0\u898f\u8ffd\u52a0\n                memoId = String.valueOf(memoDao.addMemo(content.trim()));\n                textView.setText(String.valueOf(memoId));\n            } else {\n                \/\/ \u30c7\u30fc\u30bf\u66f4\u65b0\u51e6\u7406\n                memoDao.updateContentById(memoId, content.trim());\n            }\n            memoDao.close();\n            Toast.makeText(this, \"\u4fdd\u5b58\u3057\u307e\u3057\u305f\u3002\", Toast.LENGTH_SHORT).show();\n\n            return true;\n\n        \/\/ \u524a\u9664\u30dc\u30bf\u30f3\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u51e6\u7406\n        } else if (id == R.id.actionbar_delete) {\n            TextView memoIdView = (TextView)findViewById(R.id.memo_id);\n            String memoId = memoIdView.getText().toString();\n            \/\/ \u524a\u9664\u51e6\u7406\n            MemoDao memoDao = new MemoDao(getApplicationContext());\n            memoDao.connection();\n            memoDao.delById(memoId);\n            memoDao.close();\n\n            Toast.makeText(this, \"\u524a\u9664\u3057\u307e\u3057\u305f\u3002\", Toast.LENGTH_SHORT).show();\n            finish();\/\/ activity\u7d42\u4e86\n            return true;\n\n        \/\/ \u30a2\u30af\u30b7\u30e7\u30f3\u30d0\u30fc\u306e\u623b\u308b\u304c\u30bf\u30c3\u30d7\u3055\u308c\u305f\u51e6\u7406\n        } else if (id == android.R.id.home){\n            finish();\/\/ activity\u7d42\u4e86\n            return true;\n        }\n\n        return super.onOptionsItemSelected(item);\n    }\n\n}\n\n<\/pre>\n<h2>\u305d\u306e\u4ed6<\/h2>\n<p>MemoListAdapter.java\u306f\u3001<br \/> \u300cAndroid User Interface(\u753b\u9762)\u306e\u4f5c\u308a\u65b9\u300d\u3092\u53c2\u7167<br \/> MemoDao.java\u3001DatabaseHelper.java\u306e\uff12\u30d5\u30a1\u30a4\u30eb\u306f\u3001<br \/> \u300cAndroid SQLite\u306eDB\u64cd\u4f5c\u3092\u5b66\u307c\u3046\u300d\u53c2\u7167<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4ee5\u4e0a\u3067\u3001\u300c\u3053\u308c\u304b\u3089\u306f\u3058\u3081\u308bAndroid\u30a2\u30d7\u30ea\u958b\u767a\u301c\u5165\u9580\u7de8\u301c\u300d\u306f\u3001\u7d42\u4e86\u306b\u306a\u308a\u307e\u3059\u304c\u3001<br \/> \u5982\u4f55\u3067\u3057\u305f\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u4eca\u5f8c\u306f\u3001\u6b21\u306e\u30b9\u30c6\u30c3\u30d7(\u4e2d\u7d1a\u7de8)\u3068\u3057\u3066\u3001<br \/> \u30bf\u30d6\u30ec\u30c3\u30c8\u5bfe\u5fdc\u3001\u30ab\u30ec\u30f3\u30c0\u30fc\u6a5f\u80fd\u3001\u80cc\u666f\u5909\u66f4\u6a5f\u80fd\u3001\u30d5\u30a9\u30f3\u30c8\u30ab\u30e9\u30fc\u5909\u66f4\u6a5f\u80fd\u306a\u3069\u306e<br \/> \u6a5f\u80fd\u8ffd\u52a0\u3092\u4ea4\u3048\u306a\u304c\u3089\u89e3\u8aac\u3057\u3066\u884c\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5165\u9580\u7de8\u306e\u6700\u7d42\u56de\u3068\u3057\u3066\u3001\u4eca\u307e\u3067\u89e3\u8aac\u3057\u3066\u304d\u305f\u5404\u7ae0\u3067\u7d39\u4ecb\u3057\u305f\u6a5f\u80fd\u3092\u53d6\u308a\u5165\u308c\u305f\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3092\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e&#8230;<\/p>\n","protected":false},"author":1,"featured_media":244,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","has-post-thumbnail","category-android","article cf"],"_links":{"self":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":13,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":245,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=\/wp\/v2\/media\/244"}],"wp:attachment":[{"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hundredapps.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}