我正在尝试应用drawernavigation(我的第一个片段是一个地图,其他的只是一些简单布局的片段).所以它运行良好我可以在我的片段之间导航但是当我回到第一个片段,这是一个地图我遇到了崩溃
logcat的:
11-20 11:03:27.306: E/AndroidRuntime(13787): FATAL EXCEPTION: main
11-20 11:03:27.306: E/AndroidRuntime(13787): android.view.InflateException: Binary XML file line #6: Error inflating class fragment
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-20 11:03:27.306: E/AndroidRuntime(13787): at challenge.arabe.taxitaxi.HomeFragment.onCreateView(HomeFragment.java:48)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:828)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.app.BackStackRecord.run(BackStackRecord.java:622)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1382)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.app.FragmentManagerImpl$1.run(FragmentManager.java:426)
11-20 11:03:27.306: E/AndroidRuntime(13787): at android.os.Handler.handleCallback(Handler.java:605)
11-20 11:03:27.306: E/AndroidRuntime(13787): at …Run Code Online (Sandbox Code Playgroud) android android-fragments google-maps-android-api-2 android-maps-v2 navigation-drawer
我在尝试编译一个android项目时从Jenkins控制台获得了这个输出:只是注意到我没有对主类进行任何更改这是jenkins控制台:
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.701s
[INFO] Finished at: Thu May 29 17:56:45 CEST 2014
[INFO] Final Memory: 24M/491M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/opt/jenkins/workspace/Android-Project-App/trunk/pom.xml to com.proj.android.project.mobile/project-android/0.0.1-SNAPSHOT/project-android-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /var/opt/jenkins/workspace/Android-Project-App/trunk/assets/build/project-android.apk to com.proj.android.project.mobile/project-android/0.0.1-20140529.155643-5/project-android-0.0.1-20140529.155643-5.apk
[JENKINS] Archiving /var/opt/jenkins/workspace/Android-Project-App/trunk/assets/build/project-android.jar to com.proj.android.project.mobile/project-android/0.0.1-20140529.155643-5/project-android-0.0.1-20140529.155643-5.jar
channel stopped
Archiving artifacts
ERROR: No artifacts found that match the file pattern "**/target/*.apk". Configuration error?
ERROR: ‘**/target/*.apk’ doesn’t match anything: ‘**’ exists but not ‘**/target/*.apk’
Build step 'Archive the artifacts' changed build result to FAILURE
IRC notifier plugin: Sending …Run Code Online (Sandbox Code Playgroud) 我用asynctask遇到了一些奇怪的警告.我正在学习GCM,所以我尝试使用asynctask.这是警告:
Type safety: The method execute(Object...) belongs to the raw type AsyncTask. References to generic type AsyncTask<Params,Progress,Result> should be parameterized
Run Code Online (Sandbox Code Playgroud)
我想了解这个警告的意思.它是关于线程的.为什么它不安全?这是什么原料?
这是我的代码:
private void registerInBackground() {
// TODO Auto-generated method stub
new AsyncTask() {
@Override
protected Object doInBackground(Object... arg0) {
// TODO Auto-generated method stub
String msg = "";
try {
if (gcm == null) {
gcm = GoogleCloudMessaging.getInstance(getApplicationContext());
}
regid = gcm.register(SENDER_ID);
msg = "Device registered, registration ID=" + regid;
// You should send the registration ID to your …Run Code Online (Sandbox Code Playgroud) 我从2天开始学习Maven并使用目标作为部署和安装.所以我使用了这个命令:
mvn安装android:deploy
注意:clean,install命令工作正常
这就是我得到的:
[错误]在当前项目和插件组[com.cryptolog.maven.plugins,org.apache.maven.plugins,org.codehaus.mojo]中找不到前缀'android'的插件,可从存储库[local( /home/yougostt/.m2/repository),中央
这是pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>univer.lib.androidtestxmlrpc</groupId>
<artifactId>android_xmlrpc</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.cryptolog.rpc</groupId>
<artifactId>libxmlrpc</artifactId>
<version>${rpc.version}</version>
</dependency>
<dependency>
<groupId>com.cryptolog.rpc</groupId>
<artifactId>libxmlrpc-client</artifactId>
<version>${rpc.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<properties>
<rpc.version>3.7</rpc.version>
</properties>
</project>
Run Code Online (Sandbox Code Playgroud)
我该怎么办呢?
我正在尝试使用Volley来使用Web服务。这是我的logcat输出:
12-14 10:45:41.750:I / Annuaire2error(4005):org.json.JSONException:值[{“ label”:[{“ pers_nom”:“ yen”,“ pers_id”:“ 1”,“ pers_prenom” :“ ines”,“ pers_email”:“ yen98.ines@gmail.com”,“ pers_phone”:“ 443456784”},{“ pers_nom”:“ Jamin”,“ pers_id”:“ 2”,“ pers_prenom”:“ org.json.JSONArray类型的Derkok“,” pers_email“:” jamin.drk23@gmail.com“,” pers_phone“:” 2345512398“}]}}]无法转换为JSONObject
看来它无法访问label我的Web服务的价值。如何从转换JSONArray为JSONObject?
这是我的代码:
mRequestQueue = Volley.newRequestQueue(getActivity().getApplicationContext());
JsonObjectRequest jr = new JsonObjectRequest(Request.Method.GET,url,null,new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.i(TAG,response.toString());
try{
JSONObject value = response.getJSONObject("label");
String essai = value.getString("pers_nom");
/**
* just for check
* */
Toast.makeText(getActivity(), ""+essai, Toast.LENGTH_SHORT).show();
Log.d("volley output", essai);
} catch(Exception e) {
e.printStackTrace();
} …Run Code Online (Sandbox Code Playgroud)