创建活动Android Studio后胜出死亡

时间:2018-10-31 15:36:38

标签: android-studio

我开始使用两个简单按钮来构建我的应用程序,每个按钮进入一个不同的活动,第一个进入并滑动带有片段的Tab活动,第二个进入空白活动。 问题是当我在手机中运行该应用程序时,仅单击第一个按钮便崩溃了,我签入了logcat并说了

  2018-10-31 09:29:50.340 1048-3411/system_process I/WindowManager: WIN DEATH:Window{7917183 u0      hordemuzzle.wowprofessions/hordemuzzle.wowprofessions.MainActivity}
  2018-10-31 09:29:50.341 1048-3028/system_process D/ActivityManager: cleanUpApplicationRecord -- 24131
  2018-10-31 09:29:50.341 1048-3411/system_process W/InputDispatcher:    Attempted to unregister already unregistered input channel '7917183   hordemuzzle.wowprofessions/hordemuzzle.wowprofessions.MainActivity (server)'
  2018-10-31 09:29:50.369 1048-22223/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
  2018-10-31 09:29:50.370 1048-22223/system_process D/OpenGLRenderer: Swap behavior 1
  2018-10-31 09:29:50.387 1048-24175/system_process W/ActivityManager: Ignoring remove of inactive process: ProcessRecord{f458f8e 0:hordemuzzle.wowprofessions/u0a146}
  2018-10-31 09:29:50.388 1048-1089/system_process W/AppOps: Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
  2018-10-31 09:29:50.403 1048-3387/system_process W/AlarmManager: Suspiciously short interval 10000 millis; expanding to 60 seconds
  2018-10-31 09:29:50.460 487-24170/? D/libc: dns request timeout: netid(145), id(0x172d), server(10.10.10.1)
  2018-10-31 09:29:50.463 3083-3083/com.touchtype.swiftkey E/FullInputEventModel: onStartInput event aborted: ekk: could not obtain extracted text (class ekk)

滑块活动中的标签

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


        View rootView =null;
        switch (getArguments().getInt(ARG_SECTION_NUMBER)){
            case 1:
                ///
                rootView = inflater.inflate(R.layout.fragment_main2, container, false);
                break;
            case 2:
                ///
                rootView = inflater.inflate(R.layout.fragment_fragment_main3, container, false);
                break;
        }

主要活动

//method open act open chest
    butchest=(Button) findViewById(R.id.but1);
    butchest.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            openActivitychest();
        }
    });
    //
    //method open act class
    butclass=(Button) findViewById(R.id.but2);
    butclass.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            openActivityclass();
        }
    });
    //
}
//Open act open chest
public void openActivitychest(){
    Intent intent1 = new Intent(this, Main2Activity.class);
    startActivity(intent1);
}
//
//Open act class
public void openActivityclass(){
    Intent intent2 =new Intent(this,ActivityClassguides.class);
    startActivity(intent2);

我希望有人能帮助我解决这个问题

谢谢:)

0 个答案:

没有答案