小编Ido*_*lon的帖子

查找由android平台主题定义的所有可用样式

在几个android样式教程中使用了我在android.R.style.*styles中找不到的父样式元素(http://developer.android.com/reference/android/R.style.html).

一些示例来自http://android-developers.blogspot.com/2011/04/customizing-action-bar.html操作栏文章.尼克使用父样式,如:

<style name="MyDropDownNav" parent="android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar">
...
</style>
Run Code Online (Sandbox Code Playgroud)

要么

<style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBarView_TabView">
...
</style>
Run Code Online (Sandbox Code Playgroud)

这些父母风格来自哪里?是否可以列出所有可用的父样式?

谢谢.

android themes styles

44
推荐指数
1
解决办法
5万
查看次数

一次只显示一个可扩展列表的子项

是否有可能一次只扩展一个孩子ExpandableListView,因此打开第二个孩子会关闭之前打开的孩子?

android expandablelistview expandablelistadapter

42
推荐指数
2
解决办法
2万
查看次数

如何获取android的本机方法源代码

是否可以获取并观察Android的程序组件的本机方法代码.如果有人知道怎么做,请告诉我.

android native android-source

40
推荐指数
1
解决办法
1万
查看次数

Android中的模拟器问题

当我启动模拟器时,我遇到很多问题(错误): -

HttpConnectionApp]emulator-5554 disconnected!
Cancelling 'net.paxcel.http.HttpConnectionApp activity launch'!

Emulator]emulator: ERROR: the user data image is used by another emulator.
aborting            
Run Code Online (Sandbox Code Playgroud)

每次我必须重新运行它,但都是徒劳的.

如何改进这一点以便我可以在同一个AVD上重新运行应用程序?

eclipse android adt android-virtual-device android-emulator

38
推荐指数
4
解决办法
3万
查看次数

打开Parse推送通知时出现异常

我设置了Parse push Android SDK 1.7.0并且可以毫无问题地接收推送.但是,当打开推送通知时,我的应用程序崩溃时出现以下异常:

android.content.ActivityNotFoundException:找不到处理Intent的Activity {act = android.intent.action.VIEW dat = flg = 0x1000c000(has extras)}

我也尝试了子类化ParsePushBroadcastReceiver,getActivity()总是返回主活动类,结果相同.下面是完整的堆栈跟踪:

E/AndroidRuntime? FATAL EXCEPTION: main
Process: com.ers.test, PID: 13513
java.lang.RuntimeException: Unable to start receiver com.ers.test.MyPushBroadcastReceiver: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat= flg=0x1000c000 (has extras) }
        at android.app.ActivityThread.handleReceiver(ActivityThread.java:2452)
        at android.app.ActivityThread.access$1700(ActivityThread.java:144)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1281)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5146)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
        at dalvik.system.NativeStart.main(Native Method)
 Caused by: android.content.ActivityNotFoundException: No Activity found …
Run Code Online (Sandbox Code Playgroud)

android push-notification parse-platform

38
推荐指数
2
解决办法
2万
查看次数

WebView线程永不停止(WebViewCoreThread,CookieSyncManager,http [0-3])

我使用WebView在我们的某个应用程序的活动中显示一些互联网内容.
问题是,当用户切换到此活动时,WebView的线程会继续运行!
有问题的线程是:

Thread [<17> WebViewCoreThread] (Running)
Thread [<25> CookieSyncManager] (Running)
Thread [<19> http0] (Running)
Thread [<29> http1] (Running)
Thread [<31> http2] (Running)
Thread [<33> http3] (Running)
Run Code Online (Sandbox Code Playgroud)

暂停这些线程中的每一个,并检查它正忙于做什么:

Thread [<17> WebViewCoreThread] (Suspended)
    Object.wait(long, int) line: not available [native method]
    MessageQueue(Object).wait() line: 288
    MessageQueue.next() line: 148
    Looper.loop() line: 110
    WebViewCore$WebCoreThread.run() line: 471
    Thread.run() line: 1060

Thread [<25> CookieSyncManager] (Suspended)
    Object.wait(long, int) line: not available [native method]
    MessageQueue(Object).wait(long) line: 326
    MessageQueue.next() line: 144
    Looper.loop() line: 110
    CookieSyncManager(WebSyncManager).run() line: 90
    Thread.run() line: 1060 …
Run Code Online (Sandbox Code Playgroud)

multithreading android webview

34
推荐指数
3
解决办法
4万
查看次数

什么库ld选项-lrt引用(Bionic libc)?

这个选项对ld意味着什么?

-lrt

我知道在某种程度上它意味着ld正在寻找具有实时扩展的库,但是在广泛搜索之后,我找不到这是指的确切定义(或哪个库).

使用Bionic(android)libc,android NDK文档详细说明了这个(以及pthreads)已经集成.

我问,因为它似乎是隐式的(即当我调用编译器时,直接调用自定义编译的gdc,我得到一条消息说ld找不到-lrt)

编辑

来自仿生概述

Bionic的C库附带了自己的pthread实现.这与其他历史C库不同:

- place it in an external library (-lpthread)
- play linker tricks with weak symbols at dynamic link time
Run Code Online (Sandbox Code Playgroud)

对实时功能(aka -lrt)的支持也捆绑在C库中.

问题是collect2将选项-lrt(以及-lpthreads)传递给ld.

dan@devbox:~/projects/gdc_test/jni/src$ $DC gdc_test.d -v -mthumb
Using built-in specs.
Target: arm-linux-androideabi
Configured with: /arm/ndk-git/src/build/../gcc/gcc-4.4.3/configure --prefix=/arm/ndk-git/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/arm/ndk-git/build_run/temp-install --with-mpfr=/arm/ndk-git/build_run/temp-install --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --enable-languages=c,d,c++ --enable-lto --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-shared--prefix=/arm/ndk-git/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 --enable-initfini-array --disable-nls --prefix=/arm/ndk-git/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 --with-sysroot=/arm/ndk-git/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/sysroot --with-binutils-version=2.19 --with-mpfr-version=2.4.1 --with-gmp-version=4.2.4 --with-gcc-version=4.4.3 --with-gdb-version=6.6 --with-arch=armv5te --enable-libstdc__-v3 …
Run Code Online (Sandbox Code Playgroud)

c c++ android-ndk bionic gdc

34
推荐指数
3
解决办法
5万
查看次数

拦截外发短信

是否有可能在实际发送之前拦截外发短信,获取其内容然后根据某些标准忽略/发送?

例如.阻止所有国际文本(带前导00的数字),但允许其他所有内容.

sms android intercept

29
推荐指数
4
解决办法
2万
查看次数

Android线程和数据库锁定

我们AsyncTasks用来访问数据库表和游标.

不幸的是,我们偶尔会看到有关数据库被锁定的例外情况.

E/SQLiteOpenHelper(15963): Couldn't open iviewnews.db for writing (will try read-only):
E/SQLiteOpenHelper(15963): android.database.sqlite.SQLiteException: database is locked
E/SQLiteOpenHelper(15963):  at     android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
E/SQLiteOpenHelper(15963):  at     android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1637)
E/SQLiteOpenHelper(15963):  at     android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1587)
E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:638)
E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:659)
E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:652)
E/SQLiteOpenHelper(15963):  at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:482)
E/SQLiteOpenHelper(15963):  at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193)
E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98)
E/SQLiteOpenHelper(15963):  at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:158)
E/SQLiteOpenHelper(15963):  at com.iview.android.widget.IViewNewsTopStoryWidget.initData(IViewNewsTopStoryWidget.java:73)
E/SQLiteOpenHelper(15963):  at com.iview.android.widget.IViewNewsTopStoryWidget.updateNewsWidgets(IViewNewsTopStoryWidget.java:121)
E/SQLiteOpenHelper(15963):  at com.iview.android.async.GetNewsTask.doInBackground(GetNewsTask.java:338)
E/SQLiteOpenHelper(15963):  at com.iview.android.async.GetNewsTask.doInBackground(GetNewsTask.java:1)
E/SQLiteOpenHelper(15963):  at android.os.AsyncTask$2.call(AsyncTask.java:185)
E/SQLiteOpenHelper(15963):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256)
E/SQLiteOpenHelper(15963):  at java.util.concurrent.FutureTask.run(FutureTask.java:122)
E/SQLiteOpenHelper(15963):  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)
E/SQLiteOpenHelper(15963):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
E/SQLiteOpenHelper(15963):  at java.lang.Thread.run(Thread.java:1060)
Run Code Online (Sandbox Code Playgroud)

有没有人有一个代码的一般例子,它从一个读取的不同线程写入数据库,我们如何确保线程安全. …

sqlite android locking thread-safety android-asynctask

28
推荐指数
4
解决办法
6万
查看次数

使用Matrix旋转后获取坐标的新位置

我想知道如何使用矩阵在旋转后获取矩形内的坐标的新位置.我想做的是:

  1. 定义一个矩形
  2. 在该矩形内定义坐标
  3. 旋转矩形
  4. 旋转后获取坐标的新位置

我无法弄清楚的部分是2和4.任何想法?

android rotation matrix coordinates

28
推荐指数
2
解决办法
2万
查看次数