質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

2回答

2865閲覧

Android Studioで次の画面に移っても何も表示されない

68kjo_pzdr

総合スコア8

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2017/12/14 12:30

編集2017/12/14 12:57

###発生している問題・エラーメッセージ
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'"という字はありませんでした。
コードはある本の丸写しのはずなので問題はないと思うのですが、どこを直せば解決するでしょうか。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yona

2017/12/14 12:49

画面遷移後Activityのコードとそれに設定されるレイアウトファイルを質問に追記してください。
guest

回答2

0

自己解決

ブレークポイントより手前に原因のミスが見つからなかったので、新規プロジェクトを作成してコードを全部コピペで張り直したら、普通に上手く行きました…。
おそらくいじっちゃいけないファイルを変更しちゃったりしてたのかもしれませんm(__)m

解決に協力して頂きありがとうございました。

投稿2017/12/16 23:15

68kjo_pzdr

総合スコア8

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

最初の画面が正常に表示されていることからGradle云々はおそらく関係ないと思います。
まずは、PickUpActivity#onCreateのsetContentViewにブレークポイントを設置して、デバッグ実行を行い、この行で停止するかを確認してください。

投稿2017/12/14 13:35

yona

総合スコア18155

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

68kjo_pzdr

2017/12/15 07:38

デバッグモードで実行しても5.DebugとあるところのFramesにもVariablesにも何も出てきませんでした… その他も特にふつうの実行と異なる表示が特に見当たりませんでした ブレークポイントの使用が初めてなのですがどこか見落としがあるのでしょうか (build.gradleのdebuggableはtrueにしました)
yona

2017/12/15 10:26

ブレークポイントで停止しないなら、その行の処理は行われていません。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問