Home > Mobile >  Android for help and I need to use JWCCX the arraylist with data transfer to the second interface wh
Android for help and I need to use JWCCX the arraylist with data transfer to the second interface wh

Time:09-25

Package com. Example. JWCST;

import java.io.IOException;
import java.util.ArrayList;
Import the Java. Util. HashMap;
Import the Java. Util. List;
import java.util.regex.Matcher;
Import the Java. Util. Regex. The Pattern;

The import okhttp3. Call;
The import okhttp3. Callback;
The import okhttp3. Cookies;
The import okhttp3. CookieJar;
The import okhttp3. FormBody;
The import okhttp3. HttpUrl;
The import okhttp3. OkHttpClient;
The import okhttp3. Request;
The import okhttp3. The Response;
The import android. App. The Activity;
The import android. Content. Intent;

The import android. Graphics. Bitmap;
The import android. Graphics. BitmapFactory;
The import android. OS. Bundle;
The import android. OS. Handler;
The import android. OS. The Message;
The import android. The provider. Settings. The System;
The import android. Util. Base64;
The import android. Util. Log;
The import android. View. The view;
The import android. View. The view. An OnClickListener;

The import android. Widget. The Button;
The import android. Widget. The EditText;
The import android. Widget. ImageView;
The import android. Widget. ListView.
The import android. Widget. TextView;


Public class Jwccx extends the Activity {
ArrayList ArrayList=new ArrayList (a);
ArrayList ArrayList2=new ArrayList (a);
The EditText edusrname;
The EditText edpassword;
The EditText edcode;
ModelApplication lModel;
ImageView imvcode;
The Button btnlog;
Handler Handler.
OkHttpClient httpClient.
ListView mylist.
String mainurl="http://42.247.3.125/jsxsd";
String codeurl="http://42.247.3.125/jsxsd/verifycode.servlet";
String postlogourl="http://42.247.3.125/jsxsd/xk/LoginToXk";
String cjcxstrString="http://42.247.3.125/jsxsd/kscj/cjcx_query?" ;
String cjliststr="http://42.247.3.125/jsxsd/kscj/cjcx_list";
Private HashMap CookieStore=new HashMap (a);
Public void geturlandCode ()
{
//1 url 2. Code cookies
Request the Request=new Request. The Builder (). The url (mainurl). The build ();
HttpClient. NewCall (request). The enqueue (new Callback () {

@ Override
Public void onResponse (Call arg0, Response arg1) throws IOException {
//TODO Auto - generated method stub

HttpClient=new OkHttpClient. Builder (). CookieJar (new cookieJar () {

@ Override
Public void saveFromResponse (HttpUrl HttpUrl List The list) {
//TODO Auto - generated method stub
CookieStore. Put (httpUrl. Host (), a list).
}

@ Override
Public List LoadForRequest (HttpUrl HttpUrl) {
//TODO Auto - generated method stub
List Cookies=cookieStore. Get (httpUrl. Host ());
//for (int I=0; i //the e (" cookieStore cookieStore. Get (I). The toString ());
//}
Return the cookies!=null ? Cookies: new ArrayList (a);
}
}). The build ();

Request request2=new Request. The Builder (). The url (codeurl). The build ();
The Response response2=httpClient. NewCall (request2). The execute ();
Byte [] picbytes=response2. Body () bytes ();

The Message MSG=handler. ObtainMessage ();
MSG. What=1;
MSG. Obj=picbytes;
Handler. SendMessage (MSG);
}

@ Override
Public void onFailure (Call arg0, IOException arg1) {
//TODO Auto - generated method stub

}
});






}

Public void chaxuncj ()

{


Request the Request=new Request. The Builder (). The url (cjcxstrString). The build ();
HttpClient=new OkHttpClient. Builder (). CookieJar (new cookieJar () {

@ Override
Public void saveFromResponse (HttpUrl HttpUrl List The list) {
//TODO Auto - generated method stub
CookieStore. Put (httpUrl. Host (), a list).

}

@ Override
Public List LoadForRequest (HttpUrl HttpUrl) {
//TODO Auto - generated method stub
List Cookies=cookieStore. Get (httpUrl. Host ());
//
Return the cookies!=null ? Cookies: new ArrayList (a);
}
}). The build ();

HttpClient. NewCall (request). The enqueue (new Callback () {

@ Override
Public void onResponse (Call arg0, Response arg1) throws IOException {
//TODO Auto - generated method stub
Request request2=new Request. The Builder (). The url (cjliststr). The build ();
HttpClient=new OkHttpClient. Builder (). CookieJar (new cookieJar () {

@ Override
Public void saveFromResponse (HttpUrl HttpUrl List The list) {
//TODO Auto - generated method stub
CookieStore. Put (httpUrl. Host (), a list).
}

@ Override
Public List LoadForRequest (HttpUrl HttpUrl) {
//TODO Auto - generated method stub
List Cookies=cookieStore. Get (httpUrl. Host ());
//
Return the cookies!=null ? nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related