【问题标题】:activity no longer starts活动不再开始
【发布时间】:2022-11-16 00:44:34
【问题描述】:

最近我的活动不再开始,但执行了 Toast.makeText。 我无法理解出现的 4 行错误消息。 请帮忙!

主要活动:

        btn_new.setOnClickListener(view -> {
            Toast.makeText(context, new_txt, duration).show();
            startActivity(new Intent(MainActivity.this, Neues_Protokoll.class));

            String Bauvorhaben = bauvorhaben.getText().toString();
            String Abschnitt = abschnitt.getText().toString();

            Intent intent = new Intent(this, MainActivity.class);
            intent.putExtra("Bauvorhaben", Bauvorhaben);
            intent.putExtra("Abschnitt", Abschnitt);
            startActivity(intent);
        });

错误信息:

2022-11-15 17:20:52.141 25974-25974/com.example.jasinskibdv W/MirrorManager: this model don't Support
2022-11-15 17:20:52.226 25974-25974/com.example.jasinskibdv D/CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10045; state: ENABLED
2022-11-15 17:20:52.277 25974-25974/com.example.jasinskibdv D/DecorView[]: getWindowModeFromSystem  windowmode is 1
2022-11-15 17:20:52.831 25974-26003/com.example.jasinskibdv D/OpenGLRenderer: endAllActiveAnimators on 0xb40000786faf3200 (RippleDrawable) with handle 0xb40000786fb01200
2022-11-15 17:21:21.414 25974-25989/com.example.jasinskibdv W/System: A resource failed to call close. 

【问题讨论】:

    标签: java android android-activity


    【解决方案1】:

    尝试这个,

     String Bauvorhaben = bauvorhaben.getText().toString();
     String Abschnitt = abschnitt.getText().toString();
    
    Intent myIntent = new Intent(MainActivity.this, Neues_Protokoll.class);
    myIntent.putExtra("Bauvorhaben", Bauvorhaben);
    myIntent.putExtra("Abschnitt", Abschnitt);
    MainActivity.this.startActivity(myIntent);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多