如何在选中时更改标签的颜色,请参见下面的屏幕截图:
我在ActionBar中显示橙色,同样我想用橙色代替浅蓝色.
要在ActionBar背景中显示橙色,我使用下面的代码:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.MyAppTheme" parent="android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">@style/Theme.MyAppTheme.ActionBar</item>
</style>
<style name="Theme.MyAppTheme.ActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#FF4444</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud) 我使用此源代码创建了一个自定义相机应用程序,但在少数设备上(如在高分辨率设备上)我得到:
RuntimeException setParameters failed
Run Code Online (Sandbox Code Playgroud)
由于这个原因,我面临这个例外:
params.setPictureSize(1200, 900);
Run Code Online (Sandbox Code Playgroud)
而且我注意到,如果我使用(1600, 1200)而不是(1200, 900)那时候我没有遇到这样的问题
logcat的:
11-07 11:45:20.630: E/AndroidRuntime(3827): FATAL EXCEPTION: main
11-07 11:45:20.630: E/AndroidRuntime(3827): java.lang.RuntimeException: Unable to resume activity {pl.gatti.dgcam/pl.gatti.dgcam.DgCamActivity}: java.lang.RuntimeException: setParameters failed
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2825)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2854)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2318)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.app.ActivityThread.access$600(ActivityThread.java:144)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.os.Handler.dispatchMessage(Handler.java:99)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.os.Looper.loop(Looper.java:152)
11-07 11:45:20.630: E/AndroidRuntime(3827): at android.app.ActivityThread.main(ActivityThread.java:5132)
11-07 11:45:20.630: E/AndroidRuntime(3827): at java.lang.reflect.Method.invokeNative(Native …Run Code Online (Sandbox Code Playgroud) 如何在Google Map中绘制弧形折线?
我已经使用此代码创建了弯曲的折线.
以下是绘制弯曲折线的方法:
private void showCurvedPolyline (LatLng p1, LatLng p2, double k) {
//Calculate distance and heading between two points
double d = SphericalUtil.computeDistanceBetween(p1,p2);
double h = SphericalUtil.computeHeading(p1, p2);
//Midpoint position
LatLng p = SphericalUtil.computeOffset(p1, d*0.5, h);
//Apply some mathematics to calculate position of the circle center
double x = (1-k*k)*d*0.5/(2*k);
double r = (1+k*k)*d*0.5/(2*k);
LatLng c = SphericalUtil.computeOffset(p, x, h + 90.0);
//Polyline options
PolylineOptions options = new PolylineOptions();
List<PatternItem> pattern = …Run Code Online (Sandbox Code Playgroud) android google-maps polyline android-custom-view google-maps-android-api-2
我使用的是Windows 10并安装了node-v6.9.1-x64.
这是我试图为Android平台构建的项目链接,为此我遵循那里提到的步骤,如:
首先,我已下载此项目并解压缩到D盘中的Ionic文件夹并将其重命名为IonicUserBase
其次,我已经安装了Ionic和Cordova,所以我直接开始导航到项目
第三,安装所有依赖项,我正在使用:npm install
但无法安装dependecies ....请参阅下面的完整日志
D:\>cd Ionic
D:\Ionic>cd IonicUserBase
D:\Ionic\IonicUserBase>npm install
npm WARN deprecated gulp-minify-css@0.3.13: Please use gulp-clean-css
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as …Run Code Online (Sandbox Code Playgroud) 我有问题,在尝试将原始文件夹中的音频文件复制到SD卡时,我已成功在SD卡中创建文件夹,但无法复制歌曲...
我正在使用本教程:http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/
String path = Environment.getExternalStorageDirectory() + "/PriyankaChopra" ;
File dir = new File(path);
try{
if(dir.mkdir()) {
final int[] mSongs = new int[] { R.raw.exotic, R.raw.pyaar, R.raw.tinka };
for (int i = 0; i < mSongs.length; i++) {
try {
String str_song_name= i +".mp3";
CopyRAWtoSDCard(mSongs[i], "/sdcard/PriyankaChopra/"+str_song_name);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} else {
System.out.println("Error, while Copying songs to SD Card!");
}
}catch(Exception e){
e.printStackTrace();
}
}
private void …Run Code Online (Sandbox Code Playgroud) 我正在使用SurfaceView并使用此源代码,但是每当我背靠背拍摄图像时,都会得到:
mediaserver's remote binder Camera object died
Camera service died!
Camera Error 100
Run Code Online (Sandbox Code Playgroud)
日志说:
11-06 12:11:49.691: I/Choreographer(18462): Skipped 38 frames! The application may be doing too much work on its main thread.
11-06 12:11:49.692: I/SurfaceView(18462): updateWindow -- OnPreDrawListener, mHaveFrame = true
11-06 12:11:50.372: I/View(18462): Touch down dispatch to android.widget.Button{41dfb4a8 VFED..C. ......I. 0,0-160,480 #7f050003 app:id/ibCapture}, event = MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=76.10486, y[0]=153.67984, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=9951837, downTime=9951837, deviceId=3, source=0x1002 }
11-06 12:11:50.386: I/SurfaceView(18462): updateWindow …Run Code Online (Sandbox Code Playgroud) 如何在Android中制作简单的ListView,我正在制作一个程序,我在这个样式中获取ListView:

Adapter.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:gravity="center_vertical"
android:padding="5dip" >
<!-- Title Of Song-->
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="false"
android:text="Name"
android:textSize="15dip"
android:typeface="sans" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
Activity.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:id="@+id/listView1"
android:layout_below="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:divider="@android:color/black"
android:dividerHeight="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
但是我想制作这种简单的List [相同的List SHAPE],请看下面的屏幕:

android ×6
camera ×2
cordova ×1
google-maps ×1
java ×1
listview ×1
node.js ×1
npm ×1
npm-install ×1
polyline ×1
surfaceview ×1