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

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

4
いくつかのAndroidアプリやICSに表示されるようなヘルプオーバーレイを作成するにはどうすればよいですか?
ICSが初めて読み込まれるときや、ESファイルエクスプローラーやApexランチャーなどのアプリで表示されるようなヘルプオーバーレイを作成したいと思っています(まだありますが、現時点では考えられません)。これは、1つのビューが他のビューの上にある相対的なレイアウトですか?私はそのようなことをするためのサンプルコードを見つけることができませんでした。誰もがこれがどのように行われるか知っていますか、何かアイデアがありますか?
93 android 

15
Android:Dexがバージョン52バイトのコードを解析できない
Android Studio 2.1に切り替えたところ、以前は機能していたアプリをコンパイルしようとすると、このエラーが表示されました。 Error:Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code. This is caused by library dependencies that have been compiled using Java 8 or above. If you are using the 'java' gradle plugin in a library submodule add targetCompatibility = '1.7' sourceCompatibility = '1.7' …

7
プログラムでフォントのカスタムフォントをスピナーテキストに設定する方法
アセットフォルダにttfフォントファイルがあります。私はそれをtextviewsに使用する方法を知っています: Typeface externalFont=Typeface.createFromAsset(getAssets(), "fonts/HelveticaNeueLTCom-Lt.ttf"); textview1.setTypeface(externalFont); 私はそれ自身のxmlファイルで自分のスピナーテキストの外観を定義しました(androidの通常のように): <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+android:id/text1" style="?android:attr/spinnerItemStyle" android:singleLine="true" android:textColor="#ffffff" android:gravity="center" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ellipsize="marquee" /> 私はコードからこのテキストビューを参照できません。常にnullポインター例外が発生します。例えば私が試した: TextView spinner_text=(TextView)findViewById(R.id.text1); spinner_text.setTypeface(externalFont); 独自のxmlで定義されたスピナーテキストでも、外部フォントを選択することはできますか? ありがとうございました。 答えを編集: これは機能します: String [] items = new String[2]; items[0]="Something1"; items[1]="Something2"; ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.spinaca, items) { public View getView(int position, View convertView, …

4
Androidアプリのプロファイルを作成するにはどうすればよいですか?[閉まっている]
休業。この質問には、より焦点を当てる必要があります。現在、回答を受け付けていません。 この質問を改善してみませんか?質問を更新して、この投稿を編集するだけで1つの問題に焦点を当てます。 4年前休業。 この質問を改善する 私のAndroidアプリのどこにボトルネックがあるかを見つける必要があります。 どのプロファイリングツールまたはテクニックを使用できますか?

6
CollapsingToolbarLayoutがスクロールフリングを認識しない
簡単なCollapsingToolbarLayoutを作成しましたが、これは魅力のように機能します。私の問題は、nestedscrollviewでフリングスクロールを使用しようとすると、指を離したときに停止することです。通常のスクロールは正常に機能します。 私の活動コードは変更されていません=>自動生成された空の活動。(私はちょうどandroid studioで新しい空のアクティビティを作成するをクリックし、XMLを編集しました)。 私はここを読みました。imageview自体のスクロールジェスチャーにはバグがありますが、スクロール自体にはバグがあります。ここを参照してください。 Javaコードで「スムーズスクロール」を有効にしてみました。イメージビューが表示されなくなるほどスクロールすると、フリングジェスチャが認識されます。 TLDR:イメージビューが表示されている限り、フリングジェスチャーが機能しないのはなぜですか?私のXMLコードは次のようになります。 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.AppBarLayout android:id="@+id/profile_app_bar_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:fitsSystemWindows="true"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/profile_collapsing_toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed" app:contentScrim="?attr/colorPrimary" app:expandedTitleMarginStart="48dp" app:expandedTitleMarginEnd="64dp" android:fitsSystemWindows="true"> <ImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="420dp" android:scaleType="centerCrop" android:fitsSystemWindows="true" android:src="@drawable/headerbg" android:maxHeight="192dp" app:layout_collapseMode="parallax"/> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:layout_collapseMode="pin" /> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" app:layout_anchor="@id/profile_app_bar_layout" app:layout_anchorGravity="bottom|right|end" android:layout_height="@dimen/fab_size_normal" …

14
PopupWindow-外をクリックすると閉じる
アクティビティにPopupWindowがあります。アクティビティを操作しているとき(たとえば、リストをスクロールしているとき)でも、PopupWindowは引き続き表示されます。リストをスクロールしても、PopupWindowはまだ表示されています。 私が達成したいのは、PopupWindowではない画面でタッチ/スクロール/クリックなどを行っているときに、PopupWindowを閉じたいです。メニューのしくみと同じです。メニューの外側をクリックした場合、メニューは閉じられます。 私は試しましたsetOutsideTouchable(true)が、ウィンドウを閉じません。ありがとう。


16
Android:特定のアクティビティでActionBarを非表示にする方法
私は、スプラッシュスクリーン、マップ、およびいくつかの通常のスクリーンを備えたシンプルなデモアプリケーションを開発しました。 上部にロゴを含むアクションバーがあります。私の電話(Galaxy s1 I9000 V2.3)ではすべて問題なく見えますが、Galaxy s2 v4でテストすると、スプラッシュ画面とマップ画面にもアクションバーが表示されます。 スパルシュアクティビティとマップアクティビティはActionBarActivityからも継承していないので、それをどのようにして可能にし、どうすればそれを解消できますか? マニフェスト: <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:theme="@style/Theme.AppCompat.Light" > <activity android:name=".HomeActivity" android:icon="@drawable/android_logo" android:label="" android:logo="@drawable/android_logo" > <!-- <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> --> </activity> <activity android:name=".MapActivity" android:label="" > </activity> <activity android:name=".PackageActivity" android:icon="@drawable/android_logo" android:label="" android:logo="@drawable/android_logo" > </activity> <activity android:name=".SplashActivity" android:label="" > <intent-filter> <action android:name="android.intent.action.MAIN" …

22
無許可のAndroid ADBデバイス
構成: ウィンドウズ8.1 ADBバージョン:1.0.32 スマートフォン:Oneplus One 問題 サムスンのドライバーをインストールすると言われているとおりにインストールしました。ADBデバイスコマンドを実行すると、「不正です」と表示されました。 すでに試しました: 私はこの投稿で述べられていたすべてを行いました:https : //stackoverflow.com/a/25546300/1848376 しかし問題は、接続を受け入れる必要があることを通知するプロンプトが電話に表示されないことです。 コマンドを実行するとadb shell、ここに答えがあります: error: device unauthorized. This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong. Otherwise check for a confirmation dialog on your device. 「adb kill-server」を実行しましたが、何も変わりませんでした。どうして?

8
ellipsize =“ marquee”を常にスクロールさせる方法はありますか?
TextViewでマーキー効果を使用したいのですが、TextViewがフォーカスを取得したときにのみテキストがスクロールされます。私の場合、それができないので、それは問題です。 使ってます: android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" TextViewが常にテキストをスクロールする方法はありますか?これがAndroidマーケットアプリで行われるのを見てきました。フォーカスを取得していなくても、アプリ名がタイトルバーでスクロールしますが、APIドキュメントに記載されていません。

7
オープンサイドAndroidストローク?
特定の側にのみストロークを持つAndroidシェイプオブジェクトを作成することはできますか? たとえば、私は持っています: <stroke android:width="3dip" android:color="#000000" android:dashWidth="10dip" android:dashGap="6dip" /> これはこのCSSに似ています: border: 3px dashed black; 片側だけでストロークを設定するにはどうすればよいですか?これは私がCSSでそれをする方法です: border-left: 3px dashed black; Android XMLでこれをどのように行いますか?

11
Appcompat 21でツールバーの色を変更する
Appcompat 21の新しいマテリアルデザイン機能をテストしています。したがって、次のようなツールバーを作成しました。 <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_my_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" android:background="?attr/colorPrimary" app:theme="@style/ThemeOverlay.AppCompat.ActionBar"/> それをメインのレイアウトファイルに含めました。 次に、それをsupportActionBarとして設定しました。 Toolbar toolBar = (Toolbar)findViewById(R.id.activity_my_toolbar); setSupportActionBar(toolBar); それは機能していますが、どういうわけか、ツールバーをカスタマイズする方法をまったく理解できません。それは灰色で、その上のテキストは黒です。背景とテキストの色を変更するにはどうすればよいですか? 私はこの指示を通りました: http://android-developers.blogspot.de/2014/10/appcompat-v21-material-design-for-pre.html 色を変えるために私は何を監督しましたか? <style name="AppTheme" parent="Theme.AppCompat.Light"> <item name="android:windowActionBar" tools:ignore="NewApi">false</item> <item name="windowActionBar">false</item> </style> 編集: 次のコード行をテーマに追加することで、背景色を変更できました。 <item name="colorPrimary">@color/actionbar</item> <item name="colorPrimaryDark">@color/actionbar_dark</item> ただし、テキストの色には影響しません。何が欠けていますか?黒いテキストと黒いメニューボタンの代わりに、白いテキストと白いメニューボタンの方が好きです。




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