如何从另一个片段打开活动。

时间:2014-03-15 09:41:32

标签: android

当我点击按钮时,我不会在活动和片段之间进行意图我不会去活动

public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {

        View root = inflater.inflate(R.layout.fragment_cars, container, false);

        Intent nextScreen = new Intent(getActivity(), add_cars.class);
        startActivity(nextScreen);


    } 
}

logcat错误:

03-15 11:53:39.891: D/memalloc(13472): /dev/pmem: Mapped buffer base:0x51114000 size:2826240 offset:1290240 fd:52
03-15 11:53:40.041: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:40.201: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:40.311: D/memalloc(13472): /dev/pmem: Mapped buffer base:0x51575000 size:7434240 offset:5898240 fd:55
03-15 11:53:42.651: I/System.out(13472): hi
03-15 11:53:42.721: D/memalloc(13472): /dev/pmem: Mapped buffer base:0x520f7000 size:20090880 offset:18554880 fd:58
03-15 11:53:42.831: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:42.831: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:42.851: D/memalloc(13472): /dev/pmem: Mapped buffer base:0x53420000 size:21626880 offset:20090880 fd:64
03-15 11:53:42.881: D/memalloc(13472): /dev/pmem: Unmapping buffer base:0x51114000 size:2826240 offset:1290240
03-15 11:53:42.881: D/memalloc(13472): /dev/pmem: Unmapping buffer base:0x51575000 size:7434240 offset:5898240
03-15 11:53:43.231: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:43.231: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:43.271: D/memalloc(13472): /dev/pmem: Mapped buffer base:0x51014000 size:2826240 offset:1290240 fd:49
03-15 11:53:43.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:43.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:44.141: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:44.141: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:44.641: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:44.641: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:45.141: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:45.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:45.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:45.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:46.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:46.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:46.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:46.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:47.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:47.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:47.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:47.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:48.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:48.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:48.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:48.661: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:49.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:49.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:49.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:49.651: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:50.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:50.151: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:50.661: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:50.661: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:51.161: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:53:51.161: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:53:51.661: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)glUseProgram(3)
03-15 11:55:54.891: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:55.391: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:55.391: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:55.891: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:55.891: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:56.391: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:56.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:56.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:56.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:57.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:57.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:57.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:57.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:58.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:58.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:58.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:58.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:59.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:59.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:55:59.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:55:59.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:00.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:00.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:00.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:00.901: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:01.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:01.401: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:01.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:01.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:02.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:02.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:02.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:02.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:03.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:03.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:03.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:03.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:04.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:04.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:04.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:04.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:05.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:05.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:05.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:05.911: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:06.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:06.411: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:06.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:06.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:07.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:07.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:07.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:07.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:08.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:08.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:08.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:08.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:09.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:09.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:09.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:09.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:10.421: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:10.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:10.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:10.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:11.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:11.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:11.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:11.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:12.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:12.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:12.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:12.921: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:13.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:13.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:13.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:13.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:14.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:14.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:14.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:14.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:15.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:15.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:15.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:15.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:16.431: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:16.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:16.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:16.931: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:17.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:17.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:17.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:17.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:18.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:18.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:18.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:18.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:19.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:19.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:19.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:19.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:20.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:20.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:20.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:20.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:21.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:21.441: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:21.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:21.941: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:22.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:22.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:22.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:22.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:23.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:23.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:23.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:23.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:24.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:24.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:24.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:24.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:25.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:25.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:25.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:25.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:26.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:26.451: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:26.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:26.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:27.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:27.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:27.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:27.951: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:28.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:28.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:28.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:28.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:29.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:29.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:29.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:29.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:30.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:30.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:30.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:30.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:31.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:31.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:31.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:31.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:32.461: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:32.471: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:32.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:32.961: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
03-15 11:56:33.471: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(3)
03-15 11:56:33.471: E/Adreno200-ES20(13472): <qgl2DrvAPI_glUseProgram:1318>: **** 13472: glUseProgram(6)
glUseProgram(6)

2 个答案:

答案 0 :(得分:0)

要在活动和片段之间进行通信,你可以使用界面,有很多例子,即使在Android官方网站上,这是推荐的方式。

简单地说,您在片段类中创建一个接口并在您的活动中实现它,然后使用此监听器进行通信。

查看here了解详情。

答案 1 :(得分:0)

我为你写了一个样本,看看:

片段1:

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

public class Fragment1 extends Fragment {



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        View v = inflater.inflate(R.layout.fragment1_layout, container, false);
        Button b = (Button) v.findViewById(R.id.button1);

        b.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                startActivity(new Intent(getActivity() , MainActivity.class));

            }
        });



        return v;
    }
}

MainActivity:

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class MainActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


    }

}

activity_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=".MainActivity" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" />

    <fragment
        android:id="@+id/fragment1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignLeft="@+id/textView1"
        android:layout_below="@+id/textView1" 
        class="activity.Fragment1"/>

</RelativeLayout>

fragment1_layout.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="60dp"
        android:layout_marginTop="44dp"
        android:text="Button" />

</RelativeLayout>