правильно, если гора не идёт...
Снимайте видео, отправляйте и постоянно контролируйте, вам нужно успеть сделать всё до конца гарантии, если от эпла будет указ чинить, починят или поменяют
Денис Загаевский: извините за потраченное время, я разобрался, сейчас взглянул не замыленным взглядом после прогулки и понял, что забыл написать в "onCreate" transaction.commit(); после transaction.replace(...).
Теперь всё работает
Денис Загаевский: вот весь
12-17 22:20:06.448 31457-31457/www.finefood E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.IllegalStateException: commit already called
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:683)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:662)
at www.finefood.main.MainActivity$DrawerItemClickListener.onItemClick(MainActivity.java:94)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1128)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2812)
at android.widget.AbsListView$1.run(AbsListView.java:3571)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
12-17 22:20:06.536 509-529/system_process E/AppErrorDialog: Failed to get ILowStorageHandle instance
12-17 22:20:06.962 852-852/com.google.android.gms.persistent E/ANRAppManager: RecordRateNotMatch: Count:MsgRecordSize:upTimeSize:elapsedTimeSize = 11330:17:34:34
12-17 22:20:07.514 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:190)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:926)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:915)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at iyk.d(:com.google.android.gms:212)
at iyk.c(:com.google.android.gms:158)
at iyk.aT_(:com.google.android.gms:130)
at pjb.b(:com.google.android.gms:2105)
at com.google.android.gms.googlehelp.service.ClearHelpHistoryChimeraIntentOperation.onHandleIntent(:com.google.android.gms:35)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms:118)
at com.google.android.chimera.container.IntentOperationService$HandleActionTask$IntentHandler$IntentOperationRunner.run(:com.google.android.gms:1353)
at btx.run(:com.google.android.gms:1090)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
12-17 22:20:07.517 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.database.sqlite.SQLiteConnection.(SQLiteConnection.java:170)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:190)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:926)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:915)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at iyk.d(:com.google.android.gms:212)
at iyk.c(:com.google.android.gms:158)
at iyk.aT_(:com.google.android.gms:130)
at pjb.b(:com.google.android.gms:2105)
at com.google.android.gms.googlehelp.service.ClearHelpHistoryChimeraIntentOperation.onHandleIntent(:com.google.android.gms:35)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms:118)
at com.google.android.chimera.container.IntentOperationService$HandleActionTask$IntentHandler$IntentOperationRunner.run(:com.google.android.gms:1353)
at btx.run(:com.google.android.gms:1090)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
12-17 22:20:07.522 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:190)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:926)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:915)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at iyk.d(:com.google.android.gms:212)
at iyk.c(:com.google.android.gms:158)
at iyk.aT_(:com.google.android.gms:130)
at pet.a(:com.google.android.gms:9112)
at com.google.android.gms.googlehelp.service.ClearHelpHistoryChimeraIntentOperation.onHandleIntent(:com.google.android.gms:36)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms:118)
at com.google.android.chimera.container.IntentOperationService$HandleActionTask$IntentHandler$IntentOperationRunner.run(:com.google.android.gms:1353)
at btx.run(:com.google.android.gms:1090)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
12-17 22:20:07.525 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.database.sqlite.SQLiteConnection.(SQLiteConnection.java:170)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:190)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:926)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:915)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at iyk.d(:com.google.android.gms:212)
at iyk.c(:com.google.android.gms:158)
at iyk.aT_(:com.google.android.gms:130)
at pet.a(:com.google.android.gms:9112)
at com.google.android.gms.googlehelp.service.ClearHelpHistoryChimeraIntentOperation.onHandleIntent(:com.google.android.gms:36)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms:118)
at com.google.android.chimera.container.IntentOperationService$HandleActionTask$IntentHandler$IntentOperationRunner.run(:com.google.android.gms:1353)
at btx.run(:com.google.android.gms:1090)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
12-17 22:20:07.551 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:190)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:926)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:915)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at iyk.d(:com.google.android.gms:212)
at iyk.c(:com.google.android.gms:158)
at iyk.aT_(:com.google.android.gms:130)
at pmj.a(:com.google.android.gms:1044)
at com.google.android.gms.googlehelp.service.ClearHelpHistoryChimeraIntentOperation.onHandleIntent(:com.google.android.gms:37)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms:118)
at com.google.android.chimera.container.IntentOperationService$HandleActionTask$IntentHandler$IntentOperationRunner.run(:com.google.android.gms:1353)
at btx.run(:com.google.android.gms:1090)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
12-17 22:20:07.559 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.database.sqlite.SQLiteConnection.(SQLiteConnection.java:170)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:190)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:926)
at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:915)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:223)
at iyk.d(:com.google.android.gms:212)
at iyk.c(:com.google.android.gms:158)
at iyk.aT_(:com.google.android.gms:130)
at pmj.a(:com.google.android.gms:1044)
at com.google.android.gms.googlehelp.service.ClearHelpHistoryChimeraIntentOperation.onHandleIntent(:com.google.android.gms:37)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms:118)
at com.google.android.chimera.container.IntentOperationService$HandleActionTask$IntentHandler$IntentOperationRunner.run(:com.google.android.gms:1353)
at btx.run(:com.google.android.gms:1090)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
12-17 22:20:07.615 774-774/com.android.launcher E/ANRAppManager: RecordRateNotMatch: Count:MsgRecordSize:upTimeSize:elapsedTimeSize = 20536:54:108:108
12-17 22:20:20.191 31713-31713/? E/AEE/DUMPSTATE: copy_process: execv /system/xbin/proc_mem failed(2), No such file or directory
12-17 22:21:41.800 729-729/com.android.phone E/ANRAppManager: RecordRateNotMatch: Count:MsgRecordSize:upTimeSize:elapsedTimeSize = 36810:80:160:160
Денис Загаевский: Если я правильно понял вопрос
здесь "контейнер" для фрагмента
здесь реакция на нажатие бокового меню
switch (position) {
case 0:
if (manager.findFragmentByTag("CreateMenuFragment") == null)
transaction.replace(R.id.drawer_container, createMenuFragment, createMenuFragment.getTitle());
break;
....................
если хотите сказать, что нужно в MainActivity в onCreate/onStart добавить transaction.replace(R.id.drawer_container, createMenuFragment, createMenuFragment.getTitle());
или в место replace заменить на add, то увы, падает app, но причин я понять не могу, вот отрывок от ошибки
12-17 22:20:06.536 509-529/system_process E/AppErrorDialog: Failed to get ILowStorageHandle instance
12-17 22:20:06.962 852-852/com.google.android.gms.persistent E/ANRAppManager: RecordRateNotMatch: Count:MsgRecordSize:upTimeSize:elapsedTimeSize = 11330:17:34:34
12-17 22:20:07.514 967-976/com.google.android.gms E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'close' not called
Денис Загаевский: мой код, я пишу свое тестовое приложение на основе прочитанного, увы, упёрся рогом, материал черпаю из нескольких источников, дабы получить то что мне нужно. Боковое меню работает нормально, переключает на фрагменты, но не могу понять как вывести фрагмент нужный мне при запуске активити, выводит активити без фрагмента
bychok300: нет, оставте в покое swi, ьвыкиньте это
swi.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
swi.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() - оставьте в покое swi, swi = (Switch) findViewById(R.id.switch1); и if (swi.isChecked) - это всё что нужно
bychok300: наверно потумо, что объект нужно объявлять в не метода, сначало Switch swi;
а уже в методе OnCreate: swi = (Switch) findViewById(R.id.switch1);