这是一个新项目,我想删除content_main布局,因为我对它不太熟悉,我想使用activity_main和fragment_main来处理旧方法。为此,我从activity_main.xml中删除了以下行。
<include layout="@layout/content_main" />
这会导致&#34; Hello world&#34;我在手机上运行代码时不会出现。我不确定是什么导致这种情况,以及我需要为&#34; Hello world&#34;出现?
删除此行没有帮助
tools:showIn="@layout/activity_main"
activity_main.xml代码
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
fragment_main.xml代码
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivityFragment"
tools:showIn="@layout/activity_main">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
MainActivity
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
MainActivityFragment fragment = new MainActivityFragment();
getSupportFragmentManager().beginTransaction().add(fragment,"MAIN_FRAG").commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
MainActivityFragment
public class MainActivityFragment extends Fragment {
ListView mListView;
NewsFeedAdapter mAdapter;
public MainActivityFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
//something something happens here
return rootView;
}
}
报告以下日志级别错误
10-19 22:40:15.910 611-651/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
10-19 22:40:17.100 688-688/? E/ViewRootImpl: sendUserActionEvent() mView == null
10-19 22:40:18.280 611-651/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
10-19 22:40:18.280 611-651/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
10-19 22:40:21.270 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:40:21.490 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:40:23.030 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:40:23.030 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:40:23.070 1250-1913/? E/Drive.UninstallOperation: Package still installed bw.co.fusionmedia.paper
10-19 22:40:23.150 6694-6694/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:40:23.150 6694-6694/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:40:23.170 611-802/? E/Watchdog: !@Sync 69
10-19 22:40:23.380 1250-6718/? E/IntentOperationSvc: Failed to instantiate Chimera operation impl, dropping operation
10-19 22:40:23.440 3521-3521/? E/Finsky: [1] com.google.android.finsky.wear.bo.a(836): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-19 22:40:23.850 6731-6731/bw.co.fusionmedia.paper E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
10-19 22:40:24.090 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:40:24.090 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:40:24.110 938-938/? E/NetworkScheduler.ATC: Trying to release unacquired lock: com.google.android.gms/.clearcut.service.VacuumService
10-19 22:40:53.170 611-802/? E/Watchdog: !@Sync 70
10-19 22:41:19.960 611-645/? E/lights: write_int failed to open -1
10-19 22:41:23.170 611-802/? E/Watchdog: !@Sync 71
10-19 22:41:49.870 688-688/? E/KeyguardHostView: KeyguardHostView()
10-19 22:41:49.920 688-688/? E/KeyguardHostView: ensureTransportPresentOrRemoved = 0
10-19 22:41:53.170 611-802/? E/Watchdog: !@Sync 72
10-19 22:42:23.170 611-802/? E/Watchdog: !@Sync 73
10-19 22:42:31.080 611-652/? E/SamsungWindowManager: mCoreNumLockHelper.acquire
10-19 22:42:31.080 611-696/? E/lights: write_int failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:31.110 611-645/? E/lights: write_led_info failed to open -1
10-19 22:42:32.580 611-696/? E/lights: write_int failed to open -1
10-19 22:42:34.540 611-611/? E/MotionRecognitionService: mReceiver.onReceive : ACTION_USER_PRESENT :: UNLOCK SCREEN
10-19 22:42:34.690 938-938/? E/ChimeraRcvrProxy: Can't find Chimera receiver impl class com.google.android.gms.auth.setup.devicesignals.LockScreenChimeraReceiver, dropping broadcast
10-19 22:42:53.170 611-802/? E/Watchdog: !@Sync 74
10-19 22:42:55.230 173-446/? D/: RIL_onMultiClientUnsolicitedResponse:
10-19 22:42:55.230 173-446/? E/: unsupported multiclient unsolicited response code 1009
10-19 22:42:57.810 8819-8819/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:42:57.810 8819-8819/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:43:00.920 611-651/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
10-19 22:43:04.050 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:43:04.070 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:43:05.550 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:43:05.550 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:43:05.780 1250-1913/? E/Drive.UninstallOperation: Package still installed bw.co.fusionmedia.paper
10-19 22:43:05.830 8909-8909/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:43:05.830 8909-8909/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:43:06.300 1250-8910/? E/IntentOperationSvc: Failed to instantiate Chimera operation impl, dropping operation
10-19 22:43:06.390 3521-3521/? E/Finsky: [1] com.google.android.finsky.wear.bo.a(836): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-19 22:43:06.530 8927-8927/bw.co.fusionmedia.paper E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
10-19 22:43:06.740 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:43:06.740 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:43:23.180 611-802/? E/Watchdog: !@Sync 75
10-19 22:43:27.690 9285-9285/? E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method com.android.email.service.s.a
10-19 22:43:27.690 9285-9285/? E/dalvikvm: Could not find class 'android.app.job.JobScheduler', referenced from method com.android.email.service.s.b
10-19 22:43:28.200 9285-9318/? E/Gmail: Error finding the version of the Email provider.....
10-19 22:43:28.200 9285-9318/? E/Gmail: android.content.pm.PackageManager$NameNotFoundException: com.google.android.email
10-19 22:43:28.200 9285-9318/? E/Gmail: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:108)
10-19 22:43:28.200 9285-9318/? E/Gmail: at com.google.android.gm.EmailMigrationService.a(SourceFile:1279)
10-19 22:43:28.200 9285-9318/? E/Gmail: at com.google.android.gm.EmailMigrationService.onHandleIntent(SourceFile:219)
10-19 22:43:28.200 9285-9318/? E/Gmail: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
10-19 22:43:28.200 9285-9318/? E/Gmail: at android.os.Handler.dispatchMessage(Handler.java:102)
10-19 22:43:28.200 9285-9318/? E/Gmail: at android.os.Looper.loop(Looper.java:146)
10-19 22:43:28.200 9285-9318/? E/Gmail: at android.os.HandlerThread.run(HandlerThread.java:61)
10-19 22:43:28.670 9285-9330/? E/File: fail readDirectory() errno=2
10-19 22:43:29.250 9285-9330/? E/File: fail readDirectory() errno=2
10-19 22:43:29.390 9285-9327/? E/dalvikvm: Could not find class 'javax.net.ssl.SNIHostName', referenced from method com.google.android.gms.org.conscrypt.Platform.getSSLParameters
10-19 22:43:29.400 9285-9327/? E/dalvikvm: Could not find class 'javax.net.ssl.SNIServerName', referenced from method com.google.android.gms.org.conscrypt.Platform.setSSLParameters
10-19 22:43:29.410 9285-9327/? E/dalvikvm: Could not find class 'com.google.android.gms.org.conscrypt.OpenSSLExtendedSessionImpl', referenced from method com.google.android.gms.org.conscrypt.Platform.wrapSSLSession
10-19 22:43:29.580 9285-9330/? E/File: fail readDirectory() errno=2
10-19 22:43:29.600 9285-9327/? E/dalvikvm: Could not find class 'com.google.android.gms.org.conscrypt.OpenSSLExtendedSessionImpl', referenced from method com.google.android.gms.org.conscrypt.SSLParametersImpl.getSessionToReuse
10-19 22:43:34.770 611-645/? E/lights: write_int failed to open -1
10-19 22:43:53.190 611-802/? E/Watchdog: !@Sync 76
10-19 22:44:04.800 688-688/? E/KeyguardHostView: KeyguardHostView()
10-19 22:44:04.850 688-688/? E/KeyguardHostView: ensureTransportPresentOrRemoved = 0
10-19 22:44:23.180 611-802/? E/Watchdog: !@Sync 77
10-19 22:44:53.180 611-802/? E/Watchdog: !@Sync 78
10-19 22:45:23.180 611-802/? E/Watchdog: !@Sync 79
10-19 22:45:53.180 611-802/? E/Watchdog: !@Sync 80
10-19 22:46:23.190 611-802/? E/Watchdog: !@Sync 81
10-19 22:46:53.190 611-802/? E/Watchdog: !@Sync 82
10-19 22:47:23.190 611-802/? E/Watchdog: !@Sync 83
10-19 22:47:53.190 611-802/? E/Watchdog: !@Sync 84
10-19 22:48:23.190 611-802/? E/Watchdog: !@Sync 85
10-19 22:48:49.920 611-652/? E/SamsungWindowManager: mCoreNumLockHelper.acquire
10-19 22:48:49.920 611-696/? E/lights: write_int failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:49.950 611-645/? E/lights: write_led_info failed to open -1
10-19 22:48:51.420 611-696/? E/lights: write_int failed to open -1
10-19 22:48:53.200 611-802/? E/Watchdog: !@Sync 86
10-19 22:48:53.700 611-611/? E/MotionRecognitionService: mReceiver.onReceive : ACTION_USER_PRESENT :: UNLOCK SCREEN
10-19 22:48:53.920 844-844/? E/ChimeraSrvcProxy: Can't find Chimera service impl class com.google.android.gms.clearcut.service.VacuumChimeraService
10-19 22:48:53.920 844-844/? E/ChimeraSrvcProxy: Proxy without impl dropping onStart()
10-19 22:48:53.980 938-938/? E/ChimeraRcvrProxy: Can't find Chimera receiver impl class com.google.android.gms.auth.setup.devicesignals.LockScreenChimeraReceiver, dropping broadcast
10-19 22:49:05.880 14024-14024/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:49:05.880 14024-14024/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:49:13.020 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:49:13.080 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:49:14.250 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:49:14.250 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:49:14.470 1250-1915/? E/Drive.UninstallOperation: Package still installed bw.co.fusionmedia.paper
10-19 22:49:14.750 14114-14114/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:49:14.750 14114-14114/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:49:14.850 1250-14115/? E/IntentOperationSvc: Failed to instantiate Chimera operation impl, dropping operation
10-19 22:49:14.920 3521-3521/? E/Finsky: [1] com.google.android.finsky.wear.bo.a(836): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-19 22:49:15.470 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:49:15.470 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:49:15.620 14137-14137/bw.co.fusionmedia.paper E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
10-19 22:49:23.190 611-802/? E/Watchdog: !@Sync 87
10-19 22:49:46.680 14562-14562/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:49:46.680 14562-14562/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:49:53.190 611-802/? E/Watchdog: !@Sync 88
10-19 22:49:54.370 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:49:54.390 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 22:49:55.350 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:49:55.350 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:49:55.450 1250-1915/? E/Drive.UninstallOperation: Package still installed bw.co.fusionmedia.paper
10-19 22:49:55.870 1250-14647/? E/IntentOperationSvc: Failed to instantiate Chimera operation impl, dropping operation
10-19 22:49:55.900 14651-14651/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 22:49:55.900 14651-14651/? E/android.os.Debug: failed to load memtrack module: -2
10-19 22:49:55.920 3521-3521/? E/Finsky: [1] com.google.android.finsky.wear.bo.a(836): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-19 22:49:56.160 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 22:49:56.160 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 22:49:56.710 14673-14673/bw.co.fusionmedia.paper E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
10-19 22:50:23.190 611-802/? E/Watchdog: !@Sync 89
10-19 22:50:23.230 173-446/? D/: RIL_onMultiClientUnsolicitedResponse:
10-19 22:50:23.230 173-446/? E/: unsupported multiclient unsolicited response code 1009
10-19 22:50:53.200 611-802/? E/Watchdog: !@Sync 90
10-19 22:50:54.090 611-645/? E/lights: write_int failed to open -1
10-19 22:51:23.190 611-802/? E/Watchdog: !@Sync 91
10-19 22:51:24.030 688-688/? E/KeyguardHostView: KeyguardHostView()
10-19 22:51:24.070 688-688/? E/KeyguardHostView: ensureTransportPresentOrRemoved = 0
10-19 22:51:53.190 611-802/? E/Watchdog: !@Sync 92
10-19 22:52:23.190 611-802/? E/Watchdog: !@Sync 93
10-19 22:52:53.200 611-802/? E/Watchdog: !@Sync 94
10-19 22:53:23.200 611-802/? E/Watchdog: !@Sync 95
10-19 22:53:53.210 611-802/? E/Watchdog: !@Sync 96
10-19 22:54:23.210 611-802/? E/Watchdog: !@Sync 97
10-19 22:54:53.210 611-802/? E/Watchdog: !@Sync 98
10-19 22:55:23.200 611-802/? E/Watchdog: !@Sync 99
10-19 22:55:53.200 611-802/? E/Watchdog: !@Sync 100
10-19 22:56:23.200 611-802/? E/Watchdog: !@Sync 101
10-19 22:56:53.210 611-802/? E/Watchdog: !@Sync 102
10-19 22:57:23.210 611-802/? E/Watchdog: !@Sync 103
10-19 22:57:47.260 688-688/? E/StatusBar.NetworkController_dual: updateTelephonySignalStrength: slot2 iconLevel = 4
10-19 22:57:47.260 688-688/? E/StatusBar.NetworkController_dual: updateTelephonySignalStrength: slot2 iconLevel = 4
10-19 22:57:53.200 611-802/? E/Watchdog: !@Sync 104
10-19 22:58:23.210 611-802/? E/Watchdog: !@Sync 105
10-19 22:58:53.210 611-802/? E/Watchdog: !@Sync 106
10-19 22:59:23.210 611-802/? E/Watchdog: !@Sync 107
10-19 22:59:53.210 611-802/? E/Watchdog: !@Sync 108
10-19 23:00:23.220 611-802/? E/Watchdog: !@Sync 109
10-19 23:00:53.220 611-802/? E/Watchdog: !@Sync 110
10-19 23:01:23.210 611-802/? E/Watchdog: !@Sync 111
10-19 23:01:53.210 611-802/? E/Watchdog: !@Sync 112
10-19 23:02:23.210 611-802/? E/Watchdog: !@Sync 113
10-19 23:02:53.210 611-802/? E/Watchdog: !@Sync 114
10-19 23:03:23.210 611-802/? E/Watchdog: !@Sync 115
10-19 23:03:53.210 611-802/? E/Watchdog: !@Sync 116
10-19 23:04:23.220 611-802/? E/Watchdog: !@Sync 117
10-19 23:04:53.220 611-802/? E/Watchdog: !@Sync 118
10-19 23:05:23.220 611-802/? E/Watchdog: !@Sync 119
10-19 23:05:28.940 611-652/? E/SamsungWindowManager: mCoreNumLockHelper.acquire
10-19 23:05:28.940 611-696/? E/lights: write_int failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:28.970 611-645/? E/lights: write_led_info failed to open -1
10-19 23:05:30.440 611-696/? E/lights: write_int failed to open -1
10-19 23:05:32.740 611-611/? E/MotionRecognitionService: mReceiver.onReceive : ACTION_USER_PRESENT :: UNLOCK SCREEN
10-19 23:05:32.870 938-938/? E/ChimeraRcvrProxy: Can't find Chimera receiver impl class com.google.android.gms.auth.setup.devicesignals.LockScreenChimeraReceiver, dropping broadcast
10-19 23:05:32.870 938-938/? E/NetworkScheduler.ATC: Trying to release unacquired lock: com.google.android.gms/.clearcut.service.VacuumService
10-19 23:05:43.490 27020-27020/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 23:05:43.490 27020-27020/? E/android.os.Debug: failed to load memtrack module: -2
10-19 23:05:49.950 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 23:05:50.100 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 23:05:51.720 27107-27107/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 23:05:51.720 27107-27107/? E/android.os.Debug: failed to load memtrack module: -2
10-19 23:05:52.470 27117-27123/? E/jdwp: Failed sending reply to debugger: Broken pipe
10-19 23:05:52.740 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 23:05:52.740 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 23:05:52.800 1250-1446/? E/Drive.UninstallOperation: Package still installed bw.co.fusionmedia.paper
10-19 23:05:52.960 27117-27117/? E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
10-19 23:05:53.090 1250-27130/? E/IntentOperationSvc: Failed to instantiate Chimera operation impl, dropping operation
10-19 23:05:53.100 3521-3521/? E/Finsky: [1] com.google.android.finsky.wear.bo.a(836): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-19 23:05:53.220 611-802/? E/Watchdog: !@Sync 120
10-19 23:05:53.370 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 23:05:53.370 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 23:05:53.410 1450-1450/? D/: getInstance
10-19 23:05:53.410 1450-1450/? D/: actionWC : com.sec.android.intent.action.HOME_PAUSE rebootFlag = 0
10-19 23:05:53.410 1450-1450/? I/: cp query pt : 0
10-19 23:06:23.220 611-802/? E/Watchdog: !@Sync 121
10-19 23:06:33.070 611-645/? E/lights: write_int failed to open -1
10-19 23:06:46.420 27863-27863/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 23:06:46.420 27863-27863/? E/android.os.Debug: failed to load memtrack module: -2
10-19 23:06:49.320 611-651/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
10-19 23:06:51.920 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 23:06:51.990 1569-1569/? E/SamsungIME: mOCRHelper is null
10-19 23:06:53.090 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 23:06:53.090 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 23:06:53.180 1250-1446/? E/Drive.UninstallOperation: Package still installed bw.co.fusionmedia.paper
10-19 23:06:53.220 611-802/? E/Watchdog: !@Sync 122
10-19 23:06:53.450 1250-27942/? E/IntentOperationSvc: Failed to instantiate Chimera operation impl, dropping operation
10-19 23:06:53.480 3521-3521/? E/Finsky: [1] com.google.android.finsky.wear.bo.a(836): onConnectionFailed: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
10-19 23:06:53.870 938-938/? E/NetworkScheduler.SR: Invalid parameter app
10-19 23:06:53.870 938-938/? E/NetworkScheduler.SR: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
10-19 23:06:54.170 27958-27958/? E/memtrack: Couldn't load memtrack module (No such file or directory)
10-19 23:06:54.170 27958-27958/? E/android.os.Debug: failed to load memtrack module: -2
10-19 23:06:54.670 27971-27971/? E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering
10-19 23:06:56.100 611-652/? E/SamsungWindowManager: mCoreNumLockHelper.acquire
10-19 23:06:56.110 611-696/? E/lights: write_int failed to open -1
10-19 23:06:56.140 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.140 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.140 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.140 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.140 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.140 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.150 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.150 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:56.150 611-645/? E/lights: write_led_info failed to open -1
10-19 23:06:57.600 611-696/? E/lights: write_int failed to open -1
10-19 23:07:23.220 611-802/? E/Watchdog: !@Sync 123
10-19 23:07:53.230 611-802/? E/Watchdog: !@Sync 124
10-19 23:07:56.580 611-645/? E/lights: write_int failed to open -1
答案 0 :(得分:0)
我必须为activity_main分配id,如下所示
android:id="@+id/container"
并在MainActivity的oncreate()中添加以下代码
MainActivityFragment fragment = new MainActivityFragment();
getSupportFragmentManager().beginTransaction().replace(R.id.container,fragment).commit();