- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
homeactivity.class
lv1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) { if(image_details.get(position).getQueryType().equals("service_appointment")){
Intent intent1=new Intent(getApplicationContext(),SingleClick.class);
Bundle b = new Bundle();
b.putString("UserName", username);
b.putString("Password",password);
b.putString("id", image_details.get(position).getServiceRequestnum());
b.putString("id3", image_details.get(position).getId());
intent1.putExtras(b);
startActivity(intent1);
}
else {
Intent intent2=new Intent(HomeActivity.this,SingleClickComment.class);
Bundle b = new Bundle();
b.putString("UserName", username);
b.putString("Password",password);
b.putString("id", image_details.get(position).getId());
intent2.putExtras(b);
startActivity(intent2);
}
});
SingleClickComment.class
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.singleclick);
enquiry=(TextView) findViewById(R.id.serviceEnduiry_Id);
servicestatus=(TextView) findViewById(R.id.serviceappointmentstatus);
count1=(TextView) findViewById(R.id.Count1);
time1=(TextView) findViewById(R.id.Time1);
comment1=(TextView) findViewById(R.id.Comment1);
description1=(TextView) findViewById(R.id.DEscription1);
count3=(TextView) findViewById(R.id.Count2);
singleClickComment=(EditText) findViewById(R.id.singleclickcommententry);
singleClick=(Button) findViewById(R.id.singleclickcommentbutton);
ArrayList<Comment> image_details = new ArrayList<Comment>();
image_details = GetSearchResults();
System.out.println("imagedetails:"+image_details);
final ListView lv1 = (ListView) findViewById(R.id.list10);
lv1.setAdapter(new CustomListViewAdapter1(this, image_details));
count1.setText(size+" comments");
count3.setText(size+" comments");
Intent intent2 = getIntent();
Bundle b = intent2.getExtras();
final String username= b.getString("UserName");
System.out.println("username:"+username);
final String password= b.getString("Password");
System.out.println("password:"+password);
final String id2= b.getString("id");
System.out.println("id:"+id2);
singleClick.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
//post();
String url = "http://192.168.0.199:8080/CarKonect/webresources/rest/commentInsert";
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("UserName", username));
nameValuePairs.add(new BasicNameValuePair("Password",password));
nameValuePairs.add(new BasicNameValuePair("id", id2));
nameValuePairs.add(new BasicNameValuePair("description",
singleClickComment.getText().toString()));
JSONParser1 jParser = new JSONParser1();
// getting JSON string from URL along with list values
JSONObject json = jParser.makeHttpRequest(url, method,
nameValuePairs);
try {
String value=(String) json.get("error");
System.out.println("error:"+value);
String value1=(String) json.get("Inserted");
System.out.println("insert value:"+value1);
if(value1.equals("true"))
{
Intent homeintent=new Intent(SingleClickComment.this,HomeActivity.class);
Bundle b = new Bundle();
b.putString("UserName", username);
b.putString("Password",password);
homeintent.putExtras(b);
startActivity(homeintent);
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
private ArrayList<Comment> GetSearchResults() {
// TODO Auto-generated method stub
Intent intent2 = getIntent();
Bundle b = intent2.getExtras();
final String username= b.getString("UserName");
System.out.println("username:"+username);
final String password= b.getString("Password");
System.out.println("password:"+password);
final String id2= b.getString("id");
System.out.println("id:"+id2);
ArrayList<Comment> results = new ArrayList<Comment>();
String url = "http://192.168.0.199:8080/CarKonect/webresources/rest/readSingleQuery";
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("id", id2));
nameValuePairs.add(new BasicNameValuePair("UserName", username));
nameValuePairs.add(new BasicNameValuePair("Password",password));
JSONParser1 jParser = new JSONParser1();
// getting JSON string from URL along with list values
JSONObject json = jParser.makeHttpRequest(url, method,nameValuePairs);
try {
Comment undergraduateDetailsPojoObj = new Comment();
String description=(String) json.get("Description");
System.out.println(description);
enquires=(String) json.get("Query_Id");
System.out.println( enquires);
String title=(String) json.get("Title");
System.out.println(title);
servicestatusapp=(String) json.get("Query_Status");
System.out.println(servicestatusapp);
JSONArray jsonArray = json.getJSONArray("historyList");
size=jsonArray.length();
System.out.println(size);
for(int i=0;i<=size;i++)
{
JSONObject c1 = jsonArray.getJSONObject(i);
username1=(String) c1.get("Response_From_Name");
inserteddate1=(String) c1.get("Inserted_Date");
description4=(String) c1.get("Description");
undergraduateDetailsPojoObj.setUserName(username1);
undergraduateDetailsPojoObj.setImage(1);
undergraduateDetailsPojoObj.setInsertedDate(inserteddate1);
undergraduateDetailsPojoObj.setDescription(description4);
results.add(undergraduateDetailsPojoObj);
}
}catch (JSONException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
return results;
}
}
singleclick.xml:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#2f322a" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.01"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.99"
android:orientation="vertical" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout5"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
style="@style/TitleBar"
android:layout_width = "fill_parent"
android:layout_height="43dp"
android:gravity="left|top">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width = "wrap_content"
android:layout_height="50dp"
android:gravity="left"
android:background="@drawable/customerbg"
>
<Button style="@style/TitleBarOperation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/user"
android:id="@+id/userslide"
android:textSize="10dp"
android:layout_marginTop="2dp"
android:layout_marginRight="10dip"
android:layout_marginLeft="4dip"
android:background="@drawable/home_bg"
android:layout_gravity="center"
android:layout_marginBottom="5dp"
/>
<ImageView android:layout_width="1px"
android:layout_height="fill_parent"
android:background="@drawable/divider"
android:layout_marginRight="5dip"/>
<Button style="@style/TitleBarOperation"
android:drawableTop="@drawable/write"
android:text="Write"
android:id="@+id/onwrite"
android:textSize="10dp"
android:layout_marginRight="10dip"
android:layout_marginLeft="4dip"
android:layout_marginBottom = "5dip"
android:paddingBottom = "3dip"
android:background="@drawable/home_bg"
android:layout_gravity="center"
/>
<Button style="@style/TitleBarOperation"
android:id="@+id/onschedule"
android:layout_width="50dp"
android:drawableTop="@drawable/schedule"
android:text="Schedule"
android:textSize="10dp"
android:layout_marginRight="5dip"
android:layout_marginLeft="4dip"
android:layout_marginBottom = "5dip"
android:paddingBottom = "3dip"
android:background="@drawable/home_bg"
android:layout_gravity="center"
/>
<Button style="@style/TitleBarOperation"
android:layout_width="50dp"
android:id="@+id/feedback"
android:drawableTop="@drawable/feedback"
android:text="Feedback"
android:textSize="10dp"
android:layout_marginTop="3dp"
android:layout_marginRight="10dip"
android:layout_marginLeft="4dip"
android:layout_marginBottom = "5dip"
android:paddingBottom = "3dip"
android:background="@drawable/home_bg"
android:layout_gravity="center"
/>
<Button style="@style/TitleBarOperation"
android:layout_width="50dp"
android:layout_marginTop="1dp"
android:id="@+id/truevalue"
android:drawableTop="@drawable/truevalue"
android:text="Truevalue"
android:textSize="10dp"
android:layout_marginRight="15dip"
android:layout_marginLeft="4dip"
android:layout_marginBottom = "5dip"
android:paddingBottom = "3dip" android:background="@drawable/home_bg"
android:layout_gravity="center"
/>
<ImageView android:layout_width="1px"
android:layout_height="fill_parent"
android:background="@drawable/divider"
android:layout_marginRight="1dip"/>
<Button style="@style/TitleBarOperation"
android:drawableTop="@drawable/dealer"
android:id="@+id/dealer"
android:layout_marginTop="7dp"
android:layout_marginRight="10dip"
android:layout_marginLeft="4dip"
android:layout_marginBottom = "5dip"
android:paddingBottom = "3dip"
android:background="@drawable/home_bg"
android:layout_gravity="center"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width = "fill_parent"
android:layout_height="wrap_content"
android:background="#C0C0C0">
<TextView
android:id="@+id/serviceEnduiry_Id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="30sp"
/>
<TextView
android:id="@+id/serviceappointmentstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#2f322a"
android:paddingLeft="10sp"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="2sp"
android:paddingLeft="10sp"
>
<ImageView
android:id="@+id/ImageCity1"
android:paddingTop="3sp"
android:layout_width="20sp"
android:src="@drawable/coment"
android:layout_height="20sp"
android:contentDescription="desc"
android:paddingLeft="5sp"/>
<TextView
android:id="@+id/Count1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:layout_marginRight="50sp"
android:textColor="#A1A1A1"
android:paddingLeft="5sp" />
<TextView
android:id="@+id/Time1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="#A1A1A1" />
</LinearLayout>
<TextView
android:id="@+id/Comment1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15sp"
android:textStyle="bold"
android:layout_marginRight="30sp"
android:textColor="#ffffff"
android:paddingLeft="10sp"
android:layout_marginBottom="4sp" />
<TextView
android:id="@+id/DEscription1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:paddingLeft="10sp"
android:textColor="#A1A1A1" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width = "fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="WikiCode - Custom ExpandableListView"
/>
<ExpandableListView
android:id="@+id/ExpandableListView01" android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:background="#C0C0C0"
android:childDivider="#848482"
>
</ExpandableListView>
<TextView
android:id="@+id/Count2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:layout_marginRight="50sp"
android:textColor="#A1A1A1"
android:paddingLeft="5sp" />
<ListView android:id="@+id/list10"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#C0C0C0"
android:textColor="#A1A1A1"
></ListView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="2sp"
android:paddingLeft="10sp"
>
<EditText android:id="@+id/singleclickcommententry"
android:layout_width="150sp"
android:layout_height="wrap_content"
/>
<Button android:id="@+id/singleclickcommentbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="send"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</TableRow>
</LinearLayout>
</LinearLayout>
</FrameLayout>
LOGCAT 报告
01-02 12:18:19.072: E/AndroidRuntime(3286): FATAL EXCEPTION: main 01-02 12:18:19.072: E/AndroidRuntime(3286): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidactionbar/com.example.androidactionbar.SingleClickComment}: java.lang.NullPointerException 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.os.Handler.dispatchMessage(Handler.java:99) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.os.Looper.loop(Looper.java:123) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-02 12:18:19.072: E/AndroidRuntime(3286): at java.lang.reflect.Method.invokeNative(Native Method) 01-02 12:18:19.072: E/AndroidRuntime(3286): at java.lang.reflect.Method.invoke(Method.java:521) 01-02 12:18:19.072: E/AndroidRuntime(3286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 01-02 12:18:19.072: E/AndroidRuntime(3286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 01-02 12:18:19.072: E/AndroidRuntime(3286): at dalvik.system.NativeStart.main(Native Method) 01-02 12:18:19.072: E/AndroidRuntime(3286): Caused by: java.lang.NullPointerException 01-02 12:18:19.072: E/AndroidRuntime(3286): at com.example.androidactionbar.SingleClickComment.onCreate(SingleClickComment.java:82) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-02 12:18:19.072: E/AndroidRuntime(3286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 01-02 12:18:19.072: E/AndroidRuntime(3286): ... 11 more
嗨,我正在考虑开发一种文件传输程序,想知道我是否想要尽可能好的加密,我应该使用什么? 我会用 C# 开发它,所以我可以访问 .net 库 :P在我的 usb 上有一个证书来访问服务器是没有问题的,如果
我创建的这个计算两个数组的交集是线性的方法的复杂度(在良好、平均、最差的情况下)? O(n) public void getInt(int[] a,int[] b){ int i=0; int
我已经能够使用 RTCPeerConnection.getStats() API 获得 WebRTC 音频调用的各种统计信息(抖动、RTT、丢包等)。 我需要将整体通话质量评为优秀、良好、一般或差。
基本问题: 如果我正在讲述/修改数据,我应该通过索引硬编码索引访问文件的元素,即 targetFile.getElement(5);通过硬编码标识符(内部翻译成索引),即 target.getElem
在 Linux 上,我想知道要调用什么“C”API 来获取每个 CPU 的统计信息。 我知道并且可以从我的应用程序中读取 /proc/loadavg,但这是系统范围的负载平均值,而不是每个 CPU 的
在客户端浏览器中使用 fetch api,GET 或 POST 没有问题,但 fetch 和 DELETE 有问题。它似乎将 DELETE 请求方法更改为 OPTIONS。 大多数研究表明是一个cor
我是一名优秀的程序员,十分优秀!