Questions tagged «android»

Android是Google的移动操作系统,用于对数字设备(智能手机,平板电脑,汽车,电视,Wear,Glass和IoT)进行编程或开发。对于与Android相关的主题,请使用特定于Android的标签,例如android-intent,android-activity,android-adapter等。对于与开发或编程无关但与Android框架相关的问题,请使用以下链接:https:// android.stackexchange.com。


17
媒体播放器在状态0中调用,错误(-38,0)
我目前正在尝试设计一个流互联网广播电台的简单应用。我有该电台的网址,并且正在像设置媒体播放器 MediaPlayer mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(URL); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } try { mediaPlayer.prepare(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } …

13
如何在Android中设置按钮点击效果?
在Android中,将背景图片设置为Button时,看不到按钮的任何效果。 我需要对按钮进行一些操作,以便用户可以识别该按钮已被单击。 单击按钮时,按钮应处于黑暗状态,这应该怎么办? 谢谢。
105 android 


6
Eclipse中的Android应用:编辑未在图形布局上显示的文本
我试图在Eclipse中将文本字段添加到我的Android应用程序中,但是随后我将该Plain text选项拖到了图形布局上,底部出现了一条消息。它显示为 Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V Exception details are logged in Window > Show View > Error Log 即使我去Window > Show View也没有错误日志选项。整个设计器现在已经没有用了,因为直到EditText直接从xml中删除,我才能使用它。是什么导致此错误,我该如何解决?我正在运行最新版本(截至今天6月14日至30日)和Windows 8 Pro x64。 这是我的完整布局代码: <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="${relativePackage}.${activityClass}" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="18dp" android:text="@string/welcome_text" /> <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:ems="10" …

13
Android在视图之间绘制一条水平线
我的“我的布局”如下所示: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/textView1" style="@style/behindMenuItemLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="Twitter Feeds" android:textStyle="bold" /> <ListView android:id="@+id/list" android:layout_width="350dp" android:layout_height="50dp" /> <TextView android:id="@+id/textView1" style="@style/behindMenuItemLabel1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="1dp" android:text="FaceBook Feeds" /> <ListView android:id="@+id/list1" android:layout_width="350dp" android:layout_height="50dp" /> </LinearLayout> 我的要求是在和之间绘制一条水平线TextViewListView 有人可以帮忙吗?


7
如何设置Appcompat-v7工具栏(如Theme.AppCompat.Light.DarkActionBar)的样式?
我正在尝试Theme.AppCompat.Light.DarkActionBar使用新的支持库工具栏重新创建外观。 如果我选择Theme.AppCompat.Light我的工具栏将是浅的,如果我选择Theme.AppCompat它将是黑暗的。(从技术上讲,您必须使用该.NoActionBar版本,但据我所知,唯一的区别是 <style name="Theme.AppCompat.NoActionBar"> <item name="windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style> 现在没有了,Theme.AppCompat.Light.DarkActionBar但我天真地以为自己做一个就足够了 <style name="Theme.AppCompat.Light.DarkActionBar.NoActionBar"> <item name="windowActionBar">false</item> <item name="android:windowNoTitle">true</item> </style> 但是与此有关,我的工具栏仍然是Light主题。我已经花了几个小时尝试混合Dark(基本)主题和Light主题的不同组合,但是我找不到一个可以使除工具栏之外的所有背景都具有浅色背景的组合。 有没有办法让AppCompat.Light.DarkActionBar外观与import android.support.v7.widget.Toolbar的一样?

9
毕加索的动画加载图像
我有以下代码可在Picasso中加载图像,使用可绘制的占位符在图像下载时显示。我想要的是一个动画旋转进度条样式微调器,它在图像加载时前后旋转,就像我在大多数专业应用程序中看到的那样。毕加索似乎不支持此功能,仅支持静态图像可绘制对象。有没有办法让它与毕加索一起使用,还是我必须做一些不同的事情? Picasso.with(context).load(url) .placeholder(R.drawable.loading) .error(R.drawable.image_download_error) .into(view);
105 android  picasso 

4
从sdcard将图像文件读取到位图中,为什么会出现NullPointerException?
如何从SD卡将图像文件读入位图? _path = Environment.getExternalStorageDirectory().getAbsolutePath(); System.out.println("pathhhhhhhhhhhhhhhhhhhh1111111112222222 " + _path); _path= _path + "/" + "flower2.jpg"; System.out.println("pathhhhhhhhhhhhhhhhhhhh111111111 " + _path); Bitmap bitmap = BitmapFactory.decodeFile(_path, options ); 我正在为位图获取NullPointerException。这意味着位图为空。但是我有一个图像“ .jpg”文件存储在sdcard中,作为“ flower2.jpg”。有什么问题?

7
不支持的方法:运行项目时,AndroidProject.getPluginGeneration()
我正在尝试使用Android Studio 2.2运行我的项目,但出现此错误 Unsupported method: AndroidProject.getPluginGeneration(). The version of Gradle you connect to does not support that method. 我正在使用ButterKnife 8.4.0 我的应用程式gradle.file: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } } 我的模块gradle文件: apply plugin: 'com.android.application' apply plugin: 'android-apt' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { …

3
在xml文件中写一些像“ <”的字符
从开始编程以来,在为Android开发时,我在Eclipse的string.xml中使用了一些特殊字符,例如“ &lt;-”,“” &lt;&lt;“。 一切正常工作了一年,但是今天,我只想做一些小的更改,然后开始编辑我的xml文件。 我现在得到这些字符的编译错误,因为Eclipse认为它是xml块的一部分。 关于如何在XML文件中添加此符号“ &lt;”的任何想法吗? 非常感谢。

2
Android的图表[关闭]
关闭。此问题不符合堆栈溢出准则。它当前不接受答案。 想改善这个问题吗?更新问题,使其成为Stack Overflow 的主题。 3年前关闭。 改善这个问题 我正在一个项目中,该项目具有一些图表(图形),刻度线图,烛台图和范围图。但是问题是,该图表没有库。我有用于烛台图的Google Chart API。但是我不想在Web视图中使用图表。 示例:带有Google Chart API的Android Candlestick Chart
105 android  graph  charts 

10
如何从Java的keytool中获得MD5指纹,而不仅仅是SHA-1?
当我想在应用程序中使用Google地图时,我需要调试证书的MD5指纹。我尝试了以下方法: (在这里我从bin文件夹中的C:\ Documents and Settings \ Administrator.android复制了debug.keystore文件) C:\Program Files\Java\jdk1.7.0\bin&gt;keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android 但是得到了以下结果: androiddebugkey, May 27, 2011, PrivateKeyEntry,Certificate fingerprint (SHA1): "some code" 但是,这不适用于获取MAP API密钥。SHA1是否与MD5相同? 我应该怎么做才能获得MD5证书?

11
Android使用AES进行加密/解密
已关闭。这个问题需要更加集中。它当前不接受答案。 想改善这个问题吗?更新问题,使其仅通过编辑此帖子来关注一个问题。 9个月前关闭。 改善这个问题 有没有一个很好的示例,说明如何在Android上使用AES 加密和解密图像及其他文件?
105 java  android  encryption  aes 

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.