我是Android应用程序开发的初学者.我正在使用android中的线程.我已经阅读了runOnUiThread主UI上的哪些运行代码(如果我没错?我猜.).
我的问题是主UI上的普通代码和内部代码之间的区别是什么runOnIUThread.
实施例:1
class A
{
getDataFromServer(foo);//Code on mainUI
}
Run Code Online (Sandbox Code Playgroud)
例如:2
getActivity.runOnUiThread(new Runnable(){
@Override
public void run(){
getDataFromServer(foo);
}
});
Run Code Online (Sandbox Code Playgroud)
这两个例子有什么区别.请帮助我.你的回应对我来说是一个新的学习.
我是android和xmpp的初学者,我正在开发一个使用xmpp作为协议和openfire作为server的聊天应用程序.我正在使用xmpp rest api来创建一个组.要创建一个组,我需要向服务器发送GAP请求和xml数据body ..我在android客户端使用retrofit2.当我构建我的应用程序时,它给了我这个错误
错误:
Ë
rror:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.bea.xml.stream.util.CircularQueue$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it …Run Code Online (Sandbox Code Playgroud) 我正在我的 Android 应用程序中添加谷歌地图和 firebase 消息传递,但在将错误构建为重复资源之后。
我的日志猫错误是
Error:Execution failed for task ':app:mergeDebugResources'.
> [string/google_api_key] F:\Android Workspace\FoxindTracker\app\src\main\res\values\strings.xml [string/google_api_key] F:\Android Workspace\FoxindTracker\app\build\generated\res\google-services\debug\values\values.xml: Error: Duplicate resources
Run Code Online (Sandbox Code Playgroud)
我的编译依赖如下
compile 'com.android.support:appcompat-v7:24.+'
compile 'com.android.support:design:24.+'
//compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.android.support:cardview-v7:24.+'
compile 'com.android.support:recyclerview-v7:24.+'
compile 'org.igniterealtime.smack:smack-android:4.1.4'
compile 'org.igniterealtime.smack:smack-tcp:4.1.4'
compile 'org.igniterealtime.smack:smack-im:4.1.4'
compile 'org.igniterealtime.smack:smack-extensions:4.1.4'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
// compile 'com.squareup.retrofit2:converter-simplexml:2.1.0'
compile ('com.squareup.retrofit2:converter-simplexml:2.1.0') {
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'stax', module: 'stax-api'
exclude group: 'stax', module: 'stax'
}
compile('com.digits.sdk.android:digits:1.10.3@aar') {
transitive = …Run Code Online (Sandbox Code Playgroud) android google-maps google-play-services firebase-cloud-messaging