我创建了一个简单的应用程序来测试失败的场景NoClassDefFoundError.
让我们举个例子,我有一些带有Class TestClass的Test1 android项目和一些方法.这个Test1项目我作为test1.jar导出,只导出了带有Class TestClass和的源文件夹classpath.project文件.
在另一个Android项目Test2中,我test1.jar在我的libs文件夹中添加了它.在这个Test2项目中,我有一个类Test2Class,它调用test1.jar类的方法.
在此之后,我test2.jar按照上述步骤将此Test2项目导出为文件.
因此,当我test2.jar在另一个项目中使用它时,我得到了上述错误NoClassDefFoundError.这是jar里面jar的场景.
我应该做什么,所以我能够访问罐子里的罐子.
提前致谢.
我想调试我正在开发的应用程序,这是我的第一个应用程序.我跟着一个视频,它显示在androidmanifest文件中将debuggable设置为true,我这样做了.我在androidmanifest.xml文件中的代码行android:debuggable= "true"错误是得到这个特殊错误
避免硬编码调试模式; 将其删除允许调试和发布版本自动分配一个
请有人帮我这个.
我有一个主页是地图的应用程序.
不知道为什么我收到此错误并伴随此错误 Could not find class 'gpr', referenced from method gps.a
我已经更新了eclipse,所以我尝试使用新的SHA1指纹更改为API密钥.但这不起作用.
我的应用是在您打开应用时显示当前位置.它只是落入整个地图但在LOG猫我得到这些错误.这是我的Logcat
`07-08 12:54:39.897: I/Google Maps Android API(25749): Google Play services client version: 5077000
07-08 12:54:39.907: I/dalvikvm(25749): Could not find method guj.a, referenced from method gqi.a
07-08 12:54:39.907: W/dalvikvm(25749): VFY: unable to resolve static method 24936: Lguj;.a (Landroid/content/Context;)Lgri;
07-08 12:54:39.907: D/dalvikvm(25749): VFY: replacing opcode 0x71 at 0x0003
07-08 12:54:39.917: E/dalvikvm(25749): Could not find class 'gpr', referenced from method gps.a
07-08 12:54:39.917: W/dalvikvm(25749): VFY: unable to resolve new-instance 4090 (Lgpr;) …Run Code Online (Sandbox Code Playgroud) gps android google-maps google-maps-api-2 google-maps-android-api-2
我想在该视图外部单击时隐藏视图,例如,
<Framelayout android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/imgButtonToOpenGrid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:src="@drawable/open_grid_img"
/>
<RelativeLayout
android:id="@+id/containerGrid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
>
<Button
android:id="@+id/button1grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/favourites"
/>
<Button
android:id="@+id/button2grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/recent"
android:layout_toRightOf="@+id/button1grid"
/>
<Button
android:id="@+id/button3grid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/gridview"
android:layout_toRightOf="@+id/button2grid"
/>
</RelativeLayout>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
我在我的应用程序中做的是oncreate我隐藏了具有id ="containerGrid"的RelativeLayout视图,并在我点击imageview时使该relativeLayout视图可见.
所以我的要求是当我在该容器外面点击时,我想隐藏容器RelativeLayout,其id ="containerGrid".
我试图获取framelayout容器,当点击该容器时检查是否显示了relativelayout容器,如果显示,则使其视图消失.这是我试过的代码,
containerMap = (FrameLayout)findViewById(R.id.container);
containerMap.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
if(rltvContainer.isShown()){
rltvContainer.setVisibility(View.GONE);
}
}
});
Run Code Online (Sandbox Code Playgroud)
在上面的事情中我有什么地方出错吗?
实际上我在framelayout容器中也有映射,所以在这里我期待当我点击地图时,relativelayout容器应该去.
android google-maps layout-inflater android-view navigation-drawer
我有一个应用程序,我想找到设备的确切位置.就像你乘坐出租车一样,我想找到出租车的确切位置.出租车司机将使用Android设备.因此,从该设备我想为其他想要查看驾驶室位置的用户找到驾驶室位置.
我已经尝试将驾驶室驾驶员的当前位置上传到服务器,因为驾驶室通过使用几米来移动,requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)当驾驶室按下一些启动按钮时,我已经完成了驾驶室的更新位置,或者它继续发送设备的当前位置为X米.
从该更新位置,其他用户将调用该服务并找到cab的当前位置.
在用户侧将有一张地图,他可以看到驾驶室的当前位置.用户调用该服务以查看更新的位置.我通过在该活动上设置TIMER来调用该服务,因此它会刷新并一次又一次地调用服务器.(设置计时器是最好的方法或任何其他方法).
但这种方法需要大量的数据和电池,甚至不是实时的.有没有最好的方法来找到Android设备,以便它似乎是至少实时.
我试图获得地图中心的纬度和经度.我正在使用Fragment来显示地图,
SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.mapID);
if (fm != null) {
googleMap = fm.getMap();
}
LatLng loc = googleMap.getCameraPosition().target;
Run Code Online (Sandbox Code Playgroud)
我打印这个loc,我的价值为0.0,0.0.我没有得到我错的地方.
我也尝试使用VisibleRegion地图中心的纬度和经度,但即使这样也无济于事.
android google-maps google-maps-markers google-maps-android-api-2
我试图以编程方式注册接收器以进行操作android.intent.action.BOOT_COMPLETED,即让我接收一个名为BootReceiver 的接收器类,它扩展了BroadCastReceiver类.
所以在我的一个活动课中我编写了这段代码,
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.intent.action.BOOT_COMPLETED");
intentFilter.addAction("android.intent.action.PACKAGE_REPLACED");
BootReceiver receiver = new BootReceiver();
getApplicationContext().registerReceiver(receiver, intentFilter);
Run Code Online (Sandbox Code Playgroud)
我试图同时更新app以及boot_completed动作到同一个广播接收器.
所以我尝试的是,我通过注册上面的代码运行活动,然后重新启动设备.我没有得到任何回调BootReceiver onReceive()方法.
是否可以以编程方式为boot_completed操作声明接收器,或者是否有必要在清单文件中声明接收器.
实际上我的要求是以编程方式声明它.
提前致谢.
android intentfilter broadcastreceiver android-manifest bootcompleted
android ×6
google-maps ×4
gps ×2
android-view ×1
eclipse ×1
geolocation ×1
intentfilter ×1
jar ×1
java ×1