我正面临一个小问题,需要帮助.
我不得不在笔记本电脑上重新安装Windows.之后我安装了Java,提取了Eclipse并设置了环境变量,即Path到Java bin目录,还创建了一个JAVA_HOME变量并进行设置.每次我尝试打开eclipse.exe时都会出现以下错误.
eclipse可执行程序启动程序无法找到其伴侣启动程序jar.
我在这里错过了什么?
public Button stb;
static int cnt=0;
public ArrayList<RadioButton> Butgrp1 = new ArrayList<RadioButton>();
Timer myt;
TimerTask t;
stb.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
myt.mschedule(new TimerTask() {
@Override
public void run() {
// TODO Auto-generated method stub
System.out.println("Entering run");
Handler h=new Handler();
h.post(new Runnable() {
public void run() {
// TODO Auto-generated method stub
runOnUiThread(new Runnable() {
public void run() {
// TODO Auto-generated method stub
Butgrp1.get(cnt).setChecked(true);
cnt=cnt+1;
if(cnt>4)
cnt=0;
if(cnt>0)
// Butgrp1.get(cnt-1).setChecked(false);
System.out.println(cnt);
}
});
}
});
//rg.getChildAt(cnt).setPressed(true);
} …
Run Code Online (Sandbox Code Playgroud) 我试图在我的应用程序中使用地图,我收到此错误,无法在当前主题中找到样式'mapViewStyle'
我已正确生成密钥,并已尝试在其他地方为同一问题提供的所有解决方案.
1.my target api and the one mentioned in the manifest file are the same.
2.There is no import.R in my project
3.I have cleaned my project.
4.Uses-library element is a child of the application.
Run Code Online (Sandbox Code Playgroud)
这是我的xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:apiKey="*****************"
android:enabled="true"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
这是我对应的java文件
package com.epidemicator.prototype;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class Mapacti extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
}
@Override
protected boolean isRouteDisplayed() {
// TODO …
Run Code Online (Sandbox Code Playgroud) 我需要从我的Android设备发送一个http post请求到我的localhost:8080上运行的web服务器,并由google app引擎托管.
目前的代码是这样的:
try {
HttpPost httppost = new HttpPost("http://192.168.2.220:8080");
httppost.setHeader("Content-type", "application/json");
ResponseHandler <String> responseHandler = new BasicResponseHandler();
StringEntity se = new StringEntity(object.toString());
se.setContentEncoding(newBasicHeader(HTTP.CONTENT_TYPE,"application/json"));
httppost.setEntity(se);
System.out.println("Request Sent");
String response = httpclient.execute(httppost, responseHandler);
String temp = EntityUtils.toString(response.getEntity());
} catch (ClientProtocolException e) {}
catch (IOException e) {
}
}
Run Code Online (Sandbox Code Playgroud)
我也尝试过设置:
HttpPost httppost = new HttpPost("http://10.0.2.2:8080");
Run Code Online (Sandbox Code Playgroud)
在所有情况下,响应为空并且程序强制关闭.我正确地发送请求了吗?有人可以在这里指导我吗?
谢谢
我需要知道如何为网格元素设置ChildrenRect的高度和宽度?
Grid {
id: grid1
anchors.fill: parent
rows: 10
columns: 10
childrenRect.height: background.height/10
childrenRect.width: background.width/10
}
Run Code Online (Sandbox Code Playgroud)
它说它是一个只读元素,当我尝试这样做时无法改变.