###発生している問題・エラーメッセージ
Android Studioで、ボタンを押すと画面遷移するプログラムを書いたところ、ボタンを押すと次の画面に移ったっぽい動きをするのですが、画面が表示されません。
実行前にこのような警告が出ていました。
Warning:The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1. Android SDK Build Tools 26.0.2 will be used. To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
また、エミュレータ起動時にGPU Driver Issueというものも出ていました。
GPU #1 Make: 8086 Model: Intel(R) HD Graphics Family Device ID: 0a16 Some users have experienced emulator stability issues with this driver version. As a result, we're selecting a compatibility renderer. Please check with your manufacturer to see if there is an updated driver available.
###ソースコード
<追記>画面遷移後に出したいものです。
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.kajio.twotouchmail.PickUpActivity"> <TextView android:text="@string/subject" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="18sp" android:id="@+id/textView"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editText" android:layout_below="@+id/textView" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:text="@string/button_pickup"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/place" android:id="@+id/textView3" android:layout_below="@+id/editText" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:layout_marginTop="16dp" /> <RadioGroup android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/rg_place" android:layout_below="@+id/textView3" android:layout_alignParentLeft="true" android:layout_alignParentStart="true"> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/station" android:id="@+id/radioButton1" android:checked="true"/> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/school" android:id="@+id/radioButton2" /> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/always" android:id="@+id/radioButton3" /> </RadioGroup> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_send" android:id="@+id/button" android:layout_below="@+id/rg_place" android:layout_centerHorizontal="true"/> </RelativeLayout>
package com.example.kajio.twotouchmail; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; import android.os.Debug; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; public class PickUpActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pick_up); Button btnSend = (Button) this.findViewById(R.id.button); btnSend.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ RadioGroup rgPlace = (RadioGroup)findViewById(R.id.rg_place); int checkedId = rgPlace.getCheckedRadioButtonId(); String strPlace = ((RadioButton)findViewById(checkedId)).getText().toString(); EditText edit01 = (EditText)findViewById(R.id.editText); String title = edit01.getText().toString(); Resources res = getResources(); Uri uri = Uri.parse("mailto:" + res.getString(R.string.mail_to).toString()); Intent intent = new Intent(Intent.ACTION_SENDTO, uri); intent.putExtra(Intent.EXTRA_SUBJECT, title); intent.putExtra(Intent.EXTRA_TEXT, strPlace + "に迎えに来て"); startActivity(intent); } }); } }
###試したこと
build.gradleのファイルを開けましたが、消せと言われている"buildToolsVersion '26.0.1'"という字はありませんでした。
コードはある本の丸写しのはずなので問題はないと思うのですが、どこを直せば解決するでしょうか。
回答2件
あなたの回答
tips
プレビュー