This is Java:
public class APizzaria extends Fragment {
private Button button;
View inflatedView = null;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
this.inflatedView = inflater.inflate(R.layout.pizzaria_1, container,false);
super.onCreate(savedInstanceState);
button = (Button) inflatedView.findViewById(R.id.button);
button.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
String number = "23454568678";
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" +number));
startActivity(intent);
}
});
View android = inflater.inflate(R.layout.pizzaria_1, container, false);
return android;
}
}
This is the layout:
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_below="@+id/TextView06"
android:text="@string/Telefone" />
And I've added the permissions in Manifest, can you help me figure out why it's not working? Thanks