gizmorepairs
Newbie
hi all hoping someone can help me, after trying to work on this for 2 days frustrated isnt the word lol.
this is my first attempt at creating an app and im trying to compile a feedback form i seen on youtube
instead of the two text inputs i have 13 and the design side of things has seemed to go fine but having trouble with the coding
this is as follows:
package com.example.bf1;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.renderscript.Sampler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final EditText edit1=(EditText) findViewById(R.id.edit1);
final EditText edit2=(EditText) findViewById(R.id.edit2);
EditText edit3=(EditText) findViewById(R.id.edit3);
EditText edit4=(EditText) findViewById(R.id.edit4);
EditText edit5=(EditText) findViewById(R.id.edit5);
EditText edit6=(EditText) findViewById(R.id.edit6);
EditText edit7=(EditText) findViewById(R.id.edit7);
EditText edit8=(EditText) findViewById(R.id.edit8);
EditText edit9=(EditText) findViewById(R.id.edit9);
EditText edit10=(EditText) findViewById(R.id.edit10);
EditText edit11=(EditText) findViewById(R.id.edit11);
EditText edit12=(EditText) findViewById(R.id.edit12);
EditText edit13=(EditText) findViewById(R.id.edit13);
Button button=(Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {
Intent i=new Intent(Intent.ACTION_SEND);
i.setType("message/html");
i.putExtra(Intent.EXTRA_EMAIL.new String(original: "######@gmail.com"));
i.putExtra(Intent.EXTRA_SUBJECT, "Feedback from app");
i.putExtra(Intent.EXTRA_TEXT, "Name"+edit1.getText()+"\n Message:"+edit2.getText());
try {
startActivity(Intent.createChooser(i. title: "Please select Email"));
}
catch (android.content.ActivityNotFoundException ex)
(
Toast.makeText(Context: MainActivity.this. "There are no email clients", Toast.LENGTH_SHORT);
}
});
}
}
if anybody could have a look at at this and maybe tell me where im going wrong id be very appreciative
hope someone can help and thanks in advance
this is my first attempt at creating an app and im trying to compile a feedback form i seen on youtube
instead of the two text inputs i have 13 and the design side of things has seemed to go fine but having trouble with the coding
this is as follows:
package com.example.bf1;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.renderscript.Sampler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final EditText edit1=(EditText) findViewById(R.id.edit1);
final EditText edit2=(EditText) findViewById(R.id.edit2);
EditText edit3=(EditText) findViewById(R.id.edit3);
EditText edit4=(EditText) findViewById(R.id.edit4);
EditText edit5=(EditText) findViewById(R.id.edit5);
EditText edit6=(EditText) findViewById(R.id.edit6);
EditText edit7=(EditText) findViewById(R.id.edit7);
EditText edit8=(EditText) findViewById(R.id.edit8);
EditText edit9=(EditText) findViewById(R.id.edit9);
EditText edit10=(EditText) findViewById(R.id.edit10);
EditText edit11=(EditText) findViewById(R.id.edit11);
EditText edit12=(EditText) findViewById(R.id.edit12);
EditText edit13=(EditText) findViewById(R.id.edit13);
Button button=(Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {
Intent i=new Intent(Intent.ACTION_SEND);
i.setType("message/html");
i.putExtra(Intent.EXTRA_EMAIL.new String(original: "######@gmail.com"));
i.putExtra(Intent.EXTRA_SUBJECT, "Feedback from app");
i.putExtra(Intent.EXTRA_TEXT, "Name"+edit1.getText()+"\n Message:"+edit2.getText());
try {
startActivity(Intent.createChooser(i. title: "Please select Email"));
}
catch (android.content.ActivityNotFoundException ex)
(
Toast.makeText(Context: MainActivity.this. "There are no email clients", Toast.LENGTH_SHORT);
}
});
}
}
if anybody could have a look at at this and maybe tell me where im going wrong id be very appreciative
hope someone can help and thanks in advance
