1,Create button in xml layout
<Button
android:id="@+id/feedback"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Feedback"
android:textSize="15dp" />
2,In Java Class
Button Myfeedbackbutton=(Button)findViewById (R.id.feedback); (get button id)
Myfeedbackbutton.setOnClickListener(new View.OnClickListener() (Click Listener)
{
public void onClick(View v) {
Intent feedback1= new Intent(android.content.Intent.ACTION_SEND);
feedback1.setType("text/plain");
feedback1.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"Your Email"});
feedback1.putExtra(android.content.Intent.EXTRA_SUBJECT, "Email Title");
startActivity(feedback1);
}
});
No comments:
Post a Comment