我正在调试我的代码但调试工具不可点击(即插入,退出,恢复等).我可能会意外地更改设置,但我不知道在哪里重置它.
我是新手使用Eclipse和android,请帮帮我

我有一种情况需要以编程方式在LinearLayout上设置背景.
在我的布局中,我使用`android:background ="?android:attr/activatedBackgroundIndicator"设置我的背景,但我想以编程方式设置它:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myLayoutId"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="left|center"
android:paddingBottom="5dip"
android:paddingLeft="5dip"
android:background="?android:attr/activatedBackgroundIndicator"
android:paddingTop="5dip" >
Run Code Online (Sandbox Code Playgroud)
我尝试过使用:
Drawable d = getActivity().getResources().getDrawable(android.R.attr.activatedBackgroundIndicator);
rootLayout.setBackgroundDrawable(d);
Run Code Online (Sandbox Code Playgroud)
但它崩溃了.有任何想法吗?
编辑:我也尝试过使用:
rootLayout.setBackgroundResource(android.R.attr.activatedBackgroundIndicator);
10-08 15:23:19.018: E/AndroidRuntime(11133): android.content.res.Resources$NotFoundException: Resource ID #0x10102fd
Run Code Online (Sandbox Code Playgroud) 我的问题是它不运行应用程序.
这是我的logcat:
10-17 14:43:12.574: E/Trace(684): error opening trace file: No such file or directory (2)
10-17 14:43:13.523: D/libEGL(684): Emulator without GPU support detected. Fallback to software renderer.
10-17 14:43:13.523: D/libEGL(684): loaded /system/lib/egl/libGLES_android.so
10-17 14:43:13.573: I/Choreographer(684): Skipped 44 frames! The application may be doing too much work on its main thread.
10-17 14:43:13.643: D/gralloc_goldfish(684): Emulator without GPU emulation detected.
10-17 14:43:13.653: W/dalvikvm(684): threadid=11: thread exiting with uncaught exception (group=0x40a13300)
10-17 14:43:13.653: E/AndroidRuntime(684): FATAL EXCEPTION: GLThread 78
10-17 …Run Code Online (Sandbox Code Playgroud) 我在Manifest中添加了"android.permission.WRITE_SECURE_SETTINGS".但我仍然收到一条错误消息 - 要求"WRITE_SECURE_SETTINGS".
我已经看到很多关于这个的讨论,并且这个设置被阻止用于第三方软件.
我可以添加我的应用程序的任何其他方式可以获得此权限吗?
我看到这个ADB命令,但我不太熟悉如何使用该到我的应用程序添加到我的设备,低于命令需要root我的设备也可以是在使用之前,因为它没有通过只读文件系统复制?
adb remount
adb push app.apk /system/app/
Run Code Online (Sandbox Code Playgroud) 我想在下面创建这个布局,但我似乎可以得到我需要的正确布局.我想要完成的是使用布局自定义dailog框.我尝试编辑下面的xml,但如果这显示为对话框,则定义的布局是一团糟.请帮助我理解我需要做些什么.谢谢并期待着.他们的对话框显示但不符合布局.
这个布局是我想要完成的:

对话:
View checkBoxView = View.inflate(this, R.layout.display_item_dialog, null);
CheckBox checkBox = (CheckBox)checkBoxView.findViewById(R.id.checkBox1);
checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Save to shared preferences
}
});
checkBox.setText("Search All Images");
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Image Preferences");
builder.setMessage(" Select from below ")
.setView(checkBoxView)
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).show();
Run Code Online (Sandbox Code Playgroud)
display_item_dialog.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Android应用程序,我需要连接到USB设备.
我在Windows上开发了类似的应用程序,我用c编写了驱动程序.
我想为我的Android应用程序开发一个USB驱动程序.我想知道为Android开发USB驱动程序需要什么.
要么
我可以使用ndk重用c中编写的代码吗?
谢谢,
我想在NDK级别的应用程序中测量时间.我最好喜欢用毫秒粒度的Java方式.在Java中,一个简单的调用
System.currentTimeMilliseconds()
诀窍.在NDK中是否存在完全重复的调用,或者我们是否需要使用time.h并以标准C方式进行计算?
我试图在下面的链接中使用Google提供的这些很酷的加载项
http://developer.android.com/design/downloads/index.html
但是我无法理解如何将它与eclipse集成,以便它们可以直接作为拖放工具使用.你知道如何使用它吗?
我正在使用NDK在Ecclipse ADT中开发我的android应用程序.我在c中编写了一个本机代码.我的本机代码如下所示:
#include "com_adroidappl_androidagent_ServerThread.h"
#include <stdio.h>
#include <fcntl.h>
jint fd;
void ReadMemory(jbyte* buf, jint bufflength){
fd=open("/dev/block/mmcblk0",O_RDONLY);
read(fd,buf,bufflength);
}
JNIEXPORT jlong JNICALL Java_com_adroidappl_androidagent_ServerThread_AndroidImager
(JNIEnv *env, jobject obj, jbyteArray buffer){
jbyte* buf;
jsize buflngth;
buf= (jbyte*)GetByteArrayElements(env, buffer,NULL);
buflngth= GetArrayLength(env, buffer);
ReadMemory(buf,buflngth);
return 1;
}
Run Code Online (Sandbox Code Playgroud)
在我的本机代码中,我使用的是内置的JNI API,GetByteArrayElements()和GetArrayLength().但是当我编译我的源文件时,我得到以下链接错误:
我google了很多.我找不到合适的答案.请帮我