小虾米资讯
AD1android:兄弟们帮忙看看呗,这bug快疯了
2020-12-04 10:56:25 / 我要吐槽package com.example.intentdemo3;import androidx.appcompat.app.AppCompatActivity;import android.content.ComponentName;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.EditText;public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void go(View view){ EditText tx1=findViewById(R.id.text1); EditText tx2=findViewById(R.id.text2); Intent it=new Intent("sa"); //ComponentName cn=new ComponentName(this,sencondactivity.class); //it.setComponent(cn); //it.setAction("sa"); Bundle be=new Bundle(); be.putString("text1",tx1.getText().toString()); be.putString("text2",tx2.getText().toString()); it.putExtras(be); startActivity(it); }}
定义了action和默认的category啊,好奇怪
Powered By © 小虾米资讯 2015
(本站部分文章来源于网络或网友爆料,不代表本站观点,如有侵权请联系及时删除 )