(Oh, first of all, I'm sorry for my bad English)
Hello~!
I just started to learn android programming.
I tested sending an intent object with "text/plain" to messenger app and checked it worked properly.
After sent the intent object completely, I could see a toast-like message box like below(orange one).
I want to add some confirm message like 'message sent' to that toast-like message.. What should I do?
Thank you.
Updated
Here's my code.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void sendMessage(View view) {
EditText editText = findViewById(R.id.message_edit);
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plan");
intent.putExtra(Intent.EXTRA_TEXT, editText.getText().toString());
if(intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
}
and this is the build.gradle setup of module.
compileSdkVersion 29
defaultConfig {
applicationId "com.example.actionsendexam"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Once again, thank you for reading my question.
question from:
https://stackoverflow.com/questions/65887524/is-there-anyway-to-put-complete-message-after-startactivity 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…