タグ付けされた質問 「android」

AndroidはGoogleのモバイルオペレーティングシステムであり、デジタルデバイス(スマートフォン、タブレット、自動車、TV、Wear、Glass、IoT)のプログラミングまたは開発に使用されます。Androidに関連するトピックについては、android-intent、android-activity、android-adapterなどのAndroid固有のタグを使用します。開発やプログラミング以外の質問で、Androidフレームワークに関連する質問については、次のリンクを使用してください:https:// android.stackexchange.com。



8
TextViewテキストをクリックまたはタップする方法
私はこれがとても簡単であることを知っています(doh ...)が、AndroidアプリでTextView行のテキストをタップまたはクリックしてメソッドを実行する方法を探しています。 ボタンリスナーと匿名メソッドリスナーの呼び出しについて考え続けていますが、TextViewには適用されないようです。 誰かがコードスニペットを私に向けて、TextView内のテキストの一部をクリックまたはタップするとメソッドがどのように実行されるかを示すことができますか?

29
ADTには「org.eclipse.wst.sse.core 0.0.0」が必要ですが、見つかりませんでした
Fedora 14(Linux)の新規インストールにAndroid SDKをインストールしています。私はeclipseをインストールし、tools / android sdkツールを実行してSDKのすべてのEclipseコンポーネントをインストールしました。DDMSを単独で選択すると、DDMSをインストールすることができました。 そして最後のコンポーネント-Android開発者ツールについては、以下に貼り付けた醜いエラーメッセージが表示されます。 今、私はEclipse依存関係の地獄で立ち往生しています。 Fedoraで利用可能なパッケージを検索しましたが、このEclipseの依存関係を満たすために必要なファイルが含まれているパッケージを見つけることができません。誰がEclipseが求めていること、そしてそれが住んでいるFedoraパッケージを翻訳していただけませんか? 醜いエラー: Cannot complete the install because one or more required items could not be found. Software being installed: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) Missing requirement: Android Development Tools 0.9.9.v201009221407-60953 (com.android.ide.eclipse.adt.feature.group 0.9.9.v201009221407-60953) requires 'org.eclipse.wst.sse.core 0.0.0' but it could not be found

8
Android-「戻る」ボタンをオーバーライドして、アクティビティが完了()しないようにする方法は?
現在、アクティビティが表示されているときに、通知バーにも表示されるアクティビティがあります。 これは、ユーザーがホームを押してアクティビティがバックグラウンドにプッシュされると、通知を介してアクティビティに戻ることができるようにするためです。 この問題は、ユーザーが戻るボタンを押すと発生しますが、アクティビティは破棄されますが、ユーザーが押し戻して通知を介してアクティビティにアクセスできるようにしたいため、通知は残ります。しかし、ユーザーがこれを試行すると、古いアクティビティを取り戻すのではなく、新しいアクティビティを開始しようとしているとNullポインタが表示されます。 したがって、基本的には、[戻る]ボタンを[ホーム]ボタンとまったく同じように動作させたいので、これまでに試した方法を次に示します。 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (Integer.parseInt(android.os.Build.VERSION.SDK) < 5 && keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { Log.d("CDA", "onKeyDown Called"); onBackPressed(); } return super.onKeyDown(keyCode, event); } public void onBackPressed() { Log.d("CDA", "onBackPressed Called"); Intent setIntent = new Intent(Intent.ACTION_MAIN); setIntent.addCategory(Intent.CATEGORY_HOME); setIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(setIntent); return; …

9
Androidでellipsizeはどういう意味ですか?
私が追加したEditText私のレイアウトに、とヒントを追加し、それは水平方向の中央ました。 アプリケーションを実行すると、ヒントは表示されませんでした。私は私がするべきことがわかったellipsizeの価値をTextViewしますstart: <EditText android:id="@+id/number1EditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:ellipsize="start" android:ems="10" android:gravity="center_horizontal" android:hint="@string/hint1" /> Androidのドキュメントで、私は読んだ: 設定されている場合、ビューの幅よりも長い単語 は、途中で途切れるのではなく省略されます。 問題はellipsize、辞書にないことです。誰かがellipsize属性ごとにどのようなメリットを得ることができるかを私に説明できますか?そして、の違いは何ですかstart、end、middle?

27
警告:API 'variant.getJavaCompile()'は廃止され、 'variant.getJavaCompileProvider()'に置き換えられました
Gradleの同期中に突然、次のエラーが発生します。 警告:API 'variant.getJavaCompile()'は廃止され、 'variant.getJavaCompileProvider()'に置き換えられました。2019年末に削除されます。詳細については、https ://d.android.com/r/tools/task-configuration-avoidance影響を受けるモジュール:アプリをご覧ください。 私はこれbuild.gradleをアプリモジュールに持っています: apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'io.fabric' android { compileSdkVersion 28 buildToolsVersion "28.0.2" defaultConfig { applicationId "..." minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "..." testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" versionNameSuffix = version_suffix [...] } buildTypes { release { …

17
app-release-unsigned.apkは署名されていません
Androidアプリのzipファイルをgithubにダウンロードして実行しようとしましたが、このメッセージのダイアログが表示されます app-release-unsigned.apk is not signed. Please configure the signing information for the selected flavor using the Project Structure dialog. Android Studioを使用しています。私はどうしたらいいですか?


9
Androidレイアウト要素の背景色の設定
私は、Android UIデザインの一連のスライドからアクティビティのデザインを少しクローンしようとしています。しかし、私は非常に単純なタスクで問題を抱えています。 画像のようにレイアウトを作成しTextViewましたRelativeLayout。ヘッダーはのです。の背景色を変更したいのですがRelativeLayout、どうすればいいのかわかりません。 XMLファイルのタグでandroid:backgroundプロパティを設定できることはわかっていRelativeLayoutますが、何に設定しますか?複数の場所で使用できる新しい色を定義したい。それはdrawableまたはstringですか? さらに、私はEclipse Android UIデザイナー内からこれを行う非常に簡単な方法が欠けていると予想しますか? これは最大で数回のクリックで実行されるアクティビティであるため、私は現在少しイライラしています。だからどんな助けも非常に感謝しています。:)

4
ImageViewとTextViewを含むLinearLayoutの代わりに複合ドローアブルを使用するにはどうすればよいですか
新しいLintツールをコードに対して実行しました。良い提案がたくさん出てきましたが、これはわかりません。 このタグとその子は、1つの複合ドローアブルで置き換えることができます 問題:複合ドローアブルを使用して、現在のノードをTextViewで置き換えることができるかどうかを確認します。 ImageViewとTextViewを含むLinearLayoutは、複合ドローアブルとしてより効率的に処理できます。 そして、これが私のレイアウトです <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_centerInParent="true"> <ImageView android:id="@+id/upImage" android:layout_width="20dp" android:layout_height="20dp" android:layout_gravity="center_vertical" android:scaleType="centerInside" android:src="@drawable/up_count_big"> </ImageView> <TextView android:id="@+id/LikeCount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="2dp" android:layout_marginBottom="1dp" android:textColor="@color/gray" android:textSize="16sp" android:layout_gravity="center_vertical"> </TextView> </LinearLayout> この場合、誰かが化合物を描画可能にする方法の具体的な例を提供できますか?


6
Android:配列からスピナーをプログラムで作成する
私はすべてAndroidを使い始めたばかりで、スピナーをプログラムで作成し、配列からデータを供給しようとしていますが、Eclipseで処理できないという警告が表示されます。 ここに私が得たものがあります: このArrayListは、スピナーにある必要がある要素を保持します(後でファイルから入力されます): ArrayList<String> spinnerArray = new ArrayList<String>(); これは、スピナーを作成する必要があるサイトで見つけたコードです。 Spinner spinner = new Spinner(this); ArrayAdapter spinnerArrayAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_dropdown_item, spinnerArray); spinner.setAdapter(spinnerArrayAdapter); 2行目(ArrayAdapter ...)は、Eclipseで次の警告を表示します。 "ArrayAdapter is a raw type... References to generic type ArrayAdapter<T> should be parameterized"ます。 これは単なる警告であり、アプリは問題なく実行されているようですが、何が問題かを理解して修正したいと思います。任意のヒントをいただければ幸いです。 挨拶、Select0r
198 android  spinner 

16
ImageViewの幅を埋め、アスペクト比を維持するために画像を拡大縮小する
私は持っていGridViewます。のデータはGridViewサーバーからのリクエストです。 のアイテムレイアウトはGridView次のとおりです。 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/analysis_micon_bg" android:gravity="center_horizontal" android:orientation="vertical" android:paddingBottom="@dimen/half_activity_vertical_margin" android:paddingLeft="@dimen/half_activity_horizontal_margin" android:paddingRight="@dimen/half_activity_horizontal_margin" android:paddingTop="@dimen/half_activity_vertical_margin" > <ImageView android:id="@+id/ranking_prod_pic" android:layout_width="fill_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:contentDescription="@string/app_name" android:scaleType="centerCrop" /> <TextView android:id="@+id/ranking_rank_num" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/ranking_prod_num" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/ranking_prod_name" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> サーバーにデータをリクエストし、画像のURLを取得して画像を読み込む Bitmap public static Bitmap loadBitmapFromInputStream(InputStream is) { return BitmapFactory.decodeStream(is); } public …
198 android  imageview 

2
Android:LinearLayoutに境界線を描画する方法
3つのファイルがあります。XML、描画機能、メインアクティビティ。LinearLayoutXMLファイルにいくつかあります。 <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#ef3" android:id="@+id/img01"/> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#E8A2B4" android:id="@+id/img02"/> </LinearLayout> これは描画関数です: public class getBorder extends TextView { public getBorder(Context context) { super(context); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint paint = new Paint(); paint.setColor(android.graphics.Color.RED); canvas.drawLine(0, 0, this.getWidth() - 1, …

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.