小编AAn*_*kit的帖子

缺少SDK平台Android,API 18

当我尝试安装API 18时,它只显示"Google API 18"(仅此而已).现在,如果我尝试安装这些谷歌API,Android SDK Manager它会显示一条消息"this package depends on "Missing SDK platform Android, API 18".和安装按钮被禁用.

这里有人知道如何用eclipse安装API 18(4.3_MR2 sdk)

android android-sdk-tools

80
推荐指数
3
解决办法
7万
查看次数

我们应该为OnClickListeners或内部命名类使用匿名类吗?

我的活动中有很多按钮,我有以下问题:

  1. 我应该为每个按钮为OnClickListeners创建多个内部匿名类,如下所示:

    private View.OnClickListener mShuffleListener = new View.OnClickListener() {
        public void onClick(View v) {
            /// task to do
        }
    };
    
    Run Code Online (Sandbox Code Playgroud)
  2. 或者我应该去一个命名的内部类并添加一个if条件来检查调用哪个点击监听器.

哪一个更好地节省内存资源?

java android

7
推荐指数
1
解决办法
3935
查看次数

无法解析API文件"frameworks/base/api/current.txt"

我尝试在Android框架中添加一些文件.一切顺利,除了在编译结束时,我遇到了错误.

我也试过make update-api,但没有运气,每次编译它都会给出以下错误.如果有人知道如何解决这个问题,请告诉我.

Docs droiddoc: out/target/common/docs/doc-comment-check
Checking API: checkapi-last
Checking API: checkapi-current
host layoutlib_create: out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar
Couldn't parse API file "frameworks/base/api/current.txt"
  ...as text: com.google.doclava.apicheck.ApiParseException: missing class or interface. got: private line 6342
  ...as XML:  com.google.doclava.apicheck.ApiParseException: Error parsing API
Couldn't parse API file "out/target/common/obj/PACKAGING/public_api.txt"
  ...as text: com.google.doclava.apicheck.ApiParseException: missing class or interface. got: private line 6342
  ...as XML:  com.google.doclava.apicheck.ApiParseException: Error parsing API
Exception in thread "main" java.lang.NullPointerException
    at com.google.doclava.apicheck.ApiCheck.checkApi(ApiCheck.java:118)
    at com.google.doclava.apicheck.ApiCheck.main(ApiCheck.java:67)

******************************
You have tried to change the API from what has been …
Run Code Online (Sandbox Code Playgroud)

android android-source android-framework android-make

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

什么时候使用蜂窝塔三角测量?

当网络用于定位时,这些无线网络是广播他们的ID,还是网络实际上是运营商网络,你打电话时使用的网络?

据我所知,每当我使用 GPS 时,都会使用手机信号塔来加速这个过程,这被称为 AGPS。即使在设备上禁用了无线功能,也会发生这种情况。

当您使用网络提供商时,它会使用附近的无线网络,而不会与蜂窝塔三角测量进行任何交互。为了实现这一点,必须打开无线。

这样对吗?

gps android triangulation

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

引起:java.lang.IllegalArgumentException:provider = network

试图找到我的device.code的当前位置在这里.

package com.example.location;

import android.app.Activity;    
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.Toast;


public class LocationActivity extends Activity
{

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  /* Use the LocationManager class to obtain GPS locations */
  LocationManager mlocManager = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);

  LocationListener mlocListener = new MyLocationListener();
  mlocManager.requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, mlocListener);
}

/* Class My Location Listener */
public class MyLocationListener implements LocationListener
{

  @Override
  public void …
Run Code Online (Sandbox Code Playgroud)

android

3
推荐指数
1
解决办法
8778
查看次数

我有ArrayList包含String [],如果我将新的string []添加到列表中,它还修改了以前添加的string []对象

我正在将字符串[]添加到Arraylist中,但是当我尝试从中检索值时,发生了一些错误.以及使用新条目更新arraylist的先前值(String [])预期输出:
第一个,第
1,2个,第
一个,第二个

电流输出:
一,二
,二,二,二

下面是代码.

   ArrayList<String[]> list = new ArrayList<String[]>();
   String[] temp ={"First","Sec"};
   list.add(temp);
   temp[0] ="1";temp[1]="2";
   list.add(temp);
   temp[0] ="one";temp[1]="two";
   list.add(temp);

   printLog(list);
Run Code Online (Sandbox Code Playgroud)

这是打印方法

   private void printLog(ArrayList<String[]> result) {
    for (int i = 0; i < result.size(); i++) {
        Log.d(TAG,"I="+i);
        String[] temp = result.get(i);
        Log.d(TAG,temp[0]+","+temp[1]+"\n");
    }

}
Run Code Online (Sandbox Code Playgroud)

任何建议.

java android

0
推荐指数
1
解决办法
102
查看次数