|
@@ -18,6 +18,8 @@ import android.animation.Animator;
|
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
|
|
+import android.content.SharedPreferences;
|
|
|
|
|
+import android.content.pm.PackageManager.NameNotFoundException;
|
|
|
import android.database.Cursor;
|
|
import android.database.Cursor;
|
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
|
import android.util.Log;
|
|
import android.util.Log;
|
|
@@ -31,6 +33,7 @@ import android.view.ContextMenu.ContextMenuInfo;
|
|
|
import android.view.View.OnCreateContextMenuListener;
|
|
import android.view.View.OnCreateContextMenuListener;
|
|
|
import android.widget.AdapterView.AdapterContextMenuInfo;
|
|
import android.widget.AdapterView.AdapterContextMenuInfo;
|
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.TableLayout;
|
|
import android.widget.TableLayout;
|
|
|
import android.widget.TableRow;
|
|
import android.widget.TableRow;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
@@ -42,14 +45,14 @@ public class ResultActivity extends Activity
|
|
|
String password = null;
|
|
String password = null;
|
|
|
String function_name = null;
|
|
String function_name = null;
|
|
|
private SearchTask m_task = null;
|
|
private SearchTask m_task = null;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
int sel = -1;
|
|
int sel = -1;
|
|
|
|
|
|
|
|
Bundle searchParms = null;
|
|
Bundle searchParms = null;
|
|
|
SearchResult searchresult = new SearchResult();
|
|
SearchResult searchresult = new SearchResult();
|
|
|
|
|
|
|
|
- SparseArray< String> showfieldmap = new SparseArray< String>();
|
|
|
|
|
-// HashMap<Integer, String> showfieldmap = new HashMap<Integer, String>();
|
|
|
|
|
|
|
+ SparseArray<String> showfieldmap = new SparseArray<String>();
|
|
|
|
|
+ // HashMap<Integer, String> showfieldmap = new HashMap<Integer, String>();
|
|
|
private TextView mStatusMessageView;
|
|
private TextView mStatusMessageView;
|
|
|
// private View mSearchFormView;
|
|
// private View mSearchFormView;
|
|
|
private View footview;
|
|
private View footview;
|
|
@@ -80,11 +83,13 @@ public class ResultActivity extends Activity
|
|
|
{
|
|
{
|
|
|
// TextView tv_head = (TextView) findViewById(R.id.tv_head);
|
|
// TextView tv_head = (TextView) findViewById(R.id.tv_head);
|
|
|
|
|
|
|
|
- searchresult.set_direction(1);
|
|
|
|
|
|
|
+ // searchresult.set_direction(1);
|
|
|
if (searchresult.get_totalcount() == -1)
|
|
if (searchresult.get_totalcount() == -1)
|
|
|
requestdata(true);
|
|
requestdata(true);
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
|
|
+ // if (searchresult.get_direction() == -1)
|
|
|
|
|
+ searchresult.set_offset(searchresult.get_offset() + 10);
|
|
|
requestdata(false);
|
|
requestdata(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -99,11 +104,12 @@ public class ResultActivity extends Activity
|
|
|
public void onClick(View v)
|
|
public void onClick(View v)
|
|
|
{
|
|
{
|
|
|
// TextView tv_head = (TextView) findViewById(R.id.tv_head);
|
|
// TextView tv_head = (TextView) findViewById(R.id.tv_head);
|
|
|
- searchresult.set_direction(-1);
|
|
|
|
|
|
|
+ // searchresult.set_direction(-1);
|
|
|
if (searchresult.get_totalcount() == -1)
|
|
if (searchresult.get_totalcount() == -1)
|
|
|
requestdata(true);
|
|
requestdata(true);
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
|
|
+ searchresult.set_offset(searchresult.get_offset() - 10);
|
|
|
requestdata(false);
|
|
requestdata(false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -111,6 +117,50 @@ public class ResultActivity extends Activity
|
|
|
});
|
|
});
|
|
|
mStatusView = findViewById(R.id.status);
|
|
mStatusView = findViewById(R.id.status);
|
|
|
mStatusMessageView = (TextView) findViewById(R.id.status_message);
|
|
mStatusMessageView = (TextView) findViewById(R.id.status_message);
|
|
|
|
|
+ LinearLayout ll = (LinearLayout) findViewById(R.id.ll_refresh);
|
|
|
|
|
+ Button btn_refresh = (Button) ll.findViewById(R.id.btn_refresh);
|
|
|
|
|
+ btn_refresh.setOnClickListener(new View.OnClickListener()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v)
|
|
|
|
|
+ {
|
|
|
|
|
+ LinearLayout ll = (LinearLayout) findViewById(R.id.ll_refresh);
|
|
|
|
|
+ ll.setVisibility(View.INVISIBLE);
|
|
|
|
|
+ if (searchresult.get_totalcount() == -1)
|
|
|
|
|
+ requestdata(true);
|
|
|
|
|
+ else
|
|
|
|
|
+ requestdata(false);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ SharedPreferences RunOnce = getSharedPreferences("Apex", 0);
|
|
|
|
|
+
|
|
|
|
|
+ String vername;
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ vername = getPackageManager().getPackageInfo("com.usai.apex", 0).versionName;
|
|
|
|
|
+ boolean bFirstRun = RunOnce.getBoolean("FirstRun" + vername
|
|
|
|
|
+ + "_result", true);
|
|
|
|
|
+ if (bFirstRun)
|
|
|
|
|
+ {
|
|
|
|
|
+ SharedPreferences.Editor editor = RunOnce.edit();
|
|
|
|
|
+ editor.putBoolean("FirstRun" + vername + "_result", false);
|
|
|
|
|
+ // Don't forget to commit your edits!!!
|
|
|
|
|
+ editor.commit();
|
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
|
+ intent.setClass(this, HelpActivity.class);
|
|
|
|
|
+ intent.putExtra("caller", "result");
|
|
|
|
|
+ startActivity(intent);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (NameNotFoundException e)
|
|
|
|
|
+ {
|
|
|
|
|
+ // TODO Auto-generated catch block
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
initTable();
|
|
initTable();
|
|
|
requestdata(true);
|
|
requestdata(true);
|
|
|
|
|
|
|
@@ -138,70 +188,34 @@ public class ResultActivity extends Activity
|
|
|
@Override
|
|
@Override
|
|
|
public boolean onContextItemSelected(MenuItem item)
|
|
public boolean onContextItemSelected(MenuItem item)
|
|
|
{
|
|
{
|
|
|
- // menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
|
|
|
|
|
- Log.d("table row select", sel+ "");
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // menuInfo = (AdapterContextMenuInfo) item.getMenuInfo();
|
|
|
|
|
+ // Log.d("table row select", sel+ "");
|
|
|
|
|
+
|
|
|
Intent intent = new Intent();
|
|
Intent intent = new Intent();
|
|
|
intent.setClass(this, DetailActivity.class);
|
|
intent.setClass(this, DetailActivity.class);
|
|
|
- intent.putExtra("Detail", true);
|
|
|
|
|
- intent.putExtra("Tracking", true);
|
|
|
|
|
- intent.putExtra("AMS LOG", true);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ SQLiteDatabase db = dbUtil.OpenDB(this, null, false);
|
|
|
|
|
+ Cursor cursor = db.query("actions_info",
|
|
|
|
|
+ new String[] { "name", "_id" }, "function_name='"
|
|
|
|
|
+ + function_name + "' and user='" + user + "'", null,
|
|
|
|
|
+ null, null, null, null);
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ while (cursor.moveToNext())
|
|
|
|
|
+ {
|
|
|
|
|
+ String name = cursor.getString(0);
|
|
|
|
|
+ Log.d("actionname", name);
|
|
|
|
|
+ intent.putExtra("action" + i, name);
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ intent.putExtra("function_name", function_name);
|
|
|
|
|
+ intent.putExtra("actions_count", i);
|
|
|
|
|
+ intent.putExtra("_id", searchresult.get_record(sel).get("_id")
|
|
|
|
|
+ .toString());
|
|
|
|
|
+ dbUtil.CloseCursor(cursor);
|
|
|
|
|
+ dbUtil.CloseDB(db);
|
|
|
|
|
+
|
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
|
- // Cursor cursor = (Cursor) m_ListView
|
|
|
|
|
- // .getItemAtPosition(menuInfo.position);
|
|
|
|
|
- //
|
|
|
|
|
- // switch (item.getItemId())
|
|
|
|
|
- // {
|
|
|
|
|
- // case 0:
|
|
|
|
|
- // {// remove a record
|
|
|
|
|
- // int idx = cursor.getColumnIndex("number");
|
|
|
|
|
- // String strNumber = cursor.getString(idx);
|
|
|
|
|
- // String whereclause = "number = '" + strNumber + "'";
|
|
|
|
|
- // dbUtil.removeRecords(m_db, "user_numberlist", whereclause);
|
|
|
|
|
- // RefreshList();
|
|
|
|
|
- // // m_listadapter.notifyDataSetChanged();
|
|
|
|
|
- // // this.getListAdapter().notif
|
|
|
|
|
- // break;
|
|
|
|
|
- // }
|
|
|
|
|
- // // case 1:
|
|
|
|
|
- // // {
|
|
|
|
|
- // // //edit a record;
|
|
|
|
|
- // //
|
|
|
|
|
- // // int idx = cursor.getColumnIndex("_id");
|
|
|
|
|
- // // int id = cursor.getInt(idx);
|
|
|
|
|
- // //
|
|
|
|
|
- // // Intent intent = new Intent();
|
|
|
|
|
- // // intent.setClass(this, ActivityNumberListEdit.class);
|
|
|
|
|
- // // NumberEditInfo EditInfo = new NumberEditInfo();
|
|
|
|
|
- // // EditInfo.EditType = NumberEditInfo.TYPE_EDIT;
|
|
|
|
|
- // // EditInfo.EditTableName = m_Activityinfo.TableName;
|
|
|
|
|
- // //
|
|
|
|
|
- // // EditInfo.EditRecordID =id;
|
|
|
|
|
- // // if (m_Activityinfo.TableName == "user_blacklist")
|
|
|
|
|
- // // {
|
|
|
|
|
- // // // deal with black list;
|
|
|
|
|
- // // EditInfo.EditTable = NumberEditInfo.EDIT_TABLE_BLACK;
|
|
|
|
|
- // // EditInfo.CheckTableName = "user_whitelist";
|
|
|
|
|
- // // EditInfo.LabelTextID = R.string.label_AddBlack;
|
|
|
|
|
- // // EditInfo.NumberExistMoveID = R.string.phrase_numexist_white_mov;
|
|
|
|
|
- // // EditInfo.NumberExistID = R.string.phrase_numexist_blk;
|
|
|
|
|
- // // }
|
|
|
|
|
- // // else
|
|
|
|
|
- // // {
|
|
|
|
|
- // // // deal with white list;
|
|
|
|
|
- // // EditInfo.EditTable = NumberEditInfo.EDIT_TABLE_WHITE;
|
|
|
|
|
- // // EditInfo.CheckTableName = "user_blacklist";
|
|
|
|
|
- // // EditInfo.LabelTextID = R.string.label_AddWhite;
|
|
|
|
|
- // // EditInfo.NumberExistMoveID = R.string.phrase_numexist_blk_mov;
|
|
|
|
|
- // // EditInfo.NumberExistID = R.string.phrase_numexist_white;
|
|
|
|
|
- // // }
|
|
|
|
|
- // // intent.putExtra("ActivityInfo", EditInfo);
|
|
|
|
|
- // //
|
|
|
|
|
- // // startActivity(intent);
|
|
|
|
|
- // // break;
|
|
|
|
|
- // // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+
|
|
|
return super.onContextItemSelected(item);
|
|
return super.onContextItemSelected(item);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -278,10 +292,11 @@ public class ResultActivity extends Activity
|
|
|
@Override
|
|
@Override
|
|
|
public boolean onOptionsItemSelected(MenuItem item)
|
|
public boolean onOptionsItemSelected(MenuItem item)
|
|
|
{
|
|
{
|
|
|
|
|
+ Intent intent = new Intent();
|
|
|
switch (item.getItemId())
|
|
switch (item.getItemId())
|
|
|
{
|
|
{
|
|
|
case R.id.action_custom_fields:
|
|
case R.id.action_custom_fields:
|
|
|
- Intent intent = new Intent();
|
|
|
|
|
|
|
+
|
|
|
intent.setClass(this, CustomizeFieldsActivity.class);
|
|
intent.setClass(this, CustomizeFieldsActivity.class);
|
|
|
intent.putExtra("user", user);
|
|
intent.putExtra("user", user);
|
|
|
// intent.putExtra("password", password);
|
|
// intent.putExtra("password", password);
|
|
@@ -289,7 +304,15 @@ public class ResultActivity extends Activity
|
|
|
intent.putExtra("behavior", Network.BEHAVIOR_RESULT);
|
|
intent.putExtra("behavior", Network.BEHAVIOR_RESULT);
|
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
|
break;
|
|
break;
|
|
|
-
|
|
|
|
|
|
|
+ case R.id.action_help:
|
|
|
|
|
+ // Intent intent = new Intent();
|
|
|
|
|
+ intent.setClass(this, HelpActivity.class);
|
|
|
|
|
+ intent.putExtra("caller", "result");
|
|
|
|
|
+ // // intent.putExtra("password", password);
|
|
|
|
|
+ // intent.putExtra("function_name", function_name);
|
|
|
|
|
+ // intent.putExtra("behavior", Network.BEHAVIOR_SEARCH);
|
|
|
|
|
+ startActivity(intent);
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -400,8 +423,8 @@ public class ResultActivity extends Activity
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (searchresult.get_direction() == -1)
|
|
|
|
|
- searchresult.set_offset(searchresult.get_offset() - 20);
|
|
|
|
|
|
|
+ // if (searchresult.get_direction() == -1)
|
|
|
|
|
+ // searchresult.set_offset(searchresult.get_offset() - 20);
|
|
|
searchParms.putString("offset", searchresult.get_offset() + "");
|
|
searchParms.putString("offset", searchresult.get_offset() + "");
|
|
|
|
|
|
|
|
String jstr = Network.get_records(user, password, searchParms);
|
|
String jstr = Network.get_records(user, password, searchParms);
|
|
@@ -492,6 +515,7 @@ public class ResultActivity extends Activity
|
|
|
if (totalcount == 0)
|
|
if (totalcount == 0)
|
|
|
{
|
|
{
|
|
|
tv_head.setText("0 record found");
|
|
tv_head.setText("0 record found");
|
|
|
|
|
+
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
@@ -503,7 +527,7 @@ public class ResultActivity extends Activity
|
|
|
|
|
|
|
|
tl.removeViews(1, tl.getChildCount() - 1);
|
|
tl.removeViews(1, tl.getChildCount() - 1);
|
|
|
// int newcount = loadcount - showcount + 1;// +1 header row
|
|
// int newcount = loadcount - showcount + 1;// +1 header row
|
|
|
- for (int i = 0; i < 10; i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < searchresult.get_recordscount(); i++)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
TableRow recordRow = new TableRow(ResultActivity.this);
|
|
TableRow recordRow = new TableRow(ResultActivity.this);
|
|
@@ -518,9 +542,10 @@ public class ResultActivity extends Activity
|
|
|
// v.setBackgroundColor(Color.GRAY);
|
|
// v.setBackgroundColor(Color.GRAY);
|
|
|
// v.showContextMenu();
|
|
// v.showContextMenu();
|
|
|
// return true;
|
|
// return true;
|
|
|
- TableRow tr = (TableRow)v;
|
|
|
|
|
- TextView tvno=(TextView)tr.getChildAt(0);
|
|
|
|
|
- sel=Integer.parseInt(tvno.getText().toString());
|
|
|
|
|
|
|
+ TableRow tr = (TableRow) v;
|
|
|
|
|
+ TextView tvno = (TextView) tr.getChildAt(0);
|
|
|
|
|
+ sel = Integer.parseInt(tvno.getText()
|
|
|
|
|
+ .toString()) % 10;
|
|
|
registerForContextMenu(v);
|
|
registerForContextMenu(v);
|
|
|
openContextMenu(v);
|
|
openContextMenu(v);
|
|
|
unregisterForContextMenu(v);
|
|
unregisterForContextMenu(v);
|
|
@@ -537,9 +562,8 @@ public class ResultActivity extends Activity
|
|
|
HashMap<String, String> record = searchresult.get_record(i);
|
|
HashMap<String, String> record = searchresult.get_record(i);
|
|
|
TextView field = new TextView(ResultActivity.this);
|
|
TextView field = new TextView(ResultActivity.this);
|
|
|
field.setBackgroundResource(R.drawable.tableitem);
|
|
field.setBackgroundResource(R.drawable.tableitem);
|
|
|
- field.setText(searchresult.get_offset() - 10 + i + "");
|
|
|
|
|
- Log.d("offset=" + searchresult.get_offset(), "direction="
|
|
|
|
|
- + searchresult.get_direction());
|
|
|
|
|
|
|
+ field.setText(searchresult.get_offset() + i + "");
|
|
|
|
|
+ Log.d("offset=" + searchresult.get_offset(), "");
|
|
|
field.setGravity(Gravity.CENTER);
|
|
field.setGravity(Gravity.CENTER);
|
|
|
field.setPadding(10, 5, 10, 5);
|
|
field.setPadding(10, 5, 10, 5);
|
|
|
field.setTextSize(20);
|
|
field.setTextSize(20);
|
|
@@ -547,7 +571,7 @@ public class ResultActivity extends Activity
|
|
|
for (int j = 0; j < showfieldmap.size(); j++)
|
|
for (int j = 0; j < showfieldmap.size(); j++)
|
|
|
{
|
|
{
|
|
|
TextView field1 = new TextView(ResultActivity.this);
|
|
TextView field1 = new TextView(ResultActivity.this);
|
|
|
- Log.d("onPostExecute",showfieldmap.get(j));
|
|
|
|
|
|
|
+ // Log.d("onPostExecute", showfieldmap.get(j));
|
|
|
String str = record.get(showfieldmap.get(j));
|
|
String str = record.get(showfieldmap.get(j));
|
|
|
field1.setBackgroundResource(R.drawable.tableitem);
|
|
field1.setBackgroundResource(R.drawable.tableitem);
|
|
|
if (str.toLowerCase().trim().equals("null"))
|
|
if (str.toLowerCase().trim().equals("null"))
|
|
@@ -569,7 +593,7 @@ public class ResultActivity extends Activity
|
|
|
Button btnnext = (Button) findViewById(R.id.btn_next);
|
|
Button btnnext = (Button) findViewById(R.id.btn_next);
|
|
|
|
|
|
|
|
Button btnpre = (Button) findViewById(R.id.btn_pre);
|
|
Button btnpre = (Button) findViewById(R.id.btn_pre);
|
|
|
- if (searchresult.get_offset() <= 10)
|
|
|
|
|
|
|
+ if (searchresult.get_offset() == 0)
|
|
|
btnpre.setEnabled(false);
|
|
btnpre.setEnabled(false);
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -579,42 +603,12 @@ public class ResultActivity extends Activity
|
|
|
btnnext.setEnabled(false);
|
|
btnnext.setEnabled(false);
|
|
|
else
|
|
else
|
|
|
btnnext.setEnabled(true);
|
|
btnnext.setEnabled(true);
|
|
|
- // // fill fake data
|
|
|
|
|
- // for(int i=0;i<10;i++)
|
|
|
|
|
- // {
|
|
|
|
|
- // TableRow recordRow = new TableRow(ResultActivity.this);
|
|
|
|
|
- // for(int j=0;j<showfieldmap.size();j++)
|
|
|
|
|
- // {
|
|
|
|
|
- // TextView field = new TextView(ResultActivity.this);
|
|
|
|
|
- // field.setText("fake data");
|
|
|
|
|
- // field.setGravity(Gravity.CENTER);
|
|
|
|
|
- // field.setTextAppearance(ResultActivity.this,android.R.attr.textAppearanceMedium);
|
|
|
|
|
- // recordRow.addView(field);
|
|
|
|
|
- // }
|
|
|
|
|
- // TableLayout tl=(TableLayout)findViewById(R.id.result_table);
|
|
|
|
|
- // tl.addView(recordRow);
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
|
|
|
|
|
- // SharedPreferences.Editor editor = RunOnce.edit();
|
|
|
|
|
- // editor.putBoolean("FirstRun"+globalUtil.getVerName(this),
|
|
|
|
|
- // false);
|
|
|
|
|
- // // Don't forget to commit your edits!!!
|
|
|
|
|
- // editor.commit();
|
|
|
|
|
-
|
|
|
|
|
- // Intent intent = new Intent();
|
|
|
|
|
- // intent.setClass(getActivity(), FunctionSelectActivity.class);
|
|
|
|
|
- // intent.putExtra("user", m_sUser);
|
|
|
|
|
- // intent.putExtra("password", m_sPassword);
|
|
|
|
|
- // startActivity(intent);
|
|
|
|
|
- // getActivity().finish();
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- // TextView tv_head = (TextView) findViewById(R.id.tv_head);
|
|
|
|
|
- // m_etPassword
|
|
|
|
|
- // .setError(getString(R.string.error_incorrect_password));
|
|
|
|
|
- // m_etPassword.requestFocus();
|
|
|
|
|
|
|
+ LinearLayout ll = (LinearLayout) findViewById(R.id.ll_refresh);
|
|
|
|
|
+ ll.setVisibility(View.VISIBLE);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -629,7 +623,7 @@ public class ResultActivity extends Activity
|
|
|
private class SearchResult
|
|
private class SearchResult
|
|
|
{
|
|
{
|
|
|
int total_count = -1;
|
|
int total_count = -1;
|
|
|
- int direction = 1;
|
|
|
|
|
|
|
+ // int direction = 1;
|
|
|
int offset = 0;
|
|
int offset = 0;
|
|
|
// int count = 0;
|
|
// int count = 0;
|
|
|
ArrayList<HashMap<String, String>> records = new ArrayList<HashMap<String, String>>();
|
|
ArrayList<HashMap<String, String>> records = new ArrayList<HashMap<String, String>>();
|
|
@@ -643,6 +637,11 @@ public class ResultActivity extends Activity
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
+ public int get_recordscount()
|
|
|
|
|
+ {
|
|
|
|
|
+ return records.size();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public HashMap<String, String> get_record(int i)
|
|
public HashMap<String, String> get_record(int i)
|
|
|
{
|
|
{
|
|
|
return records.get(i);
|
|
return records.get(i);
|
|
@@ -656,14 +655,15 @@ public class ResultActivity extends Activity
|
|
|
JSONObject objrecords = new JSONObject(jsonstr);
|
|
JSONObject objrecords = new JSONObject(jsonstr);
|
|
|
for (int i = 0; i < objrecords.length(); i++)
|
|
for (int i = 0; i < objrecords.length(); i++)
|
|
|
{
|
|
{
|
|
|
- offset++;
|
|
|
|
|
|
|
+ // offset++;
|
|
|
JSONObject rec = objrecords.getJSONObject("record" + i);
|
|
JSONObject rec = objrecords.getJSONObject("record" + i);
|
|
|
Iterator<?> it = rec.keys();
|
|
Iterator<?> it = rec.keys();
|
|
|
HashMap<String, String> record = new HashMap<String, String>();
|
|
HashMap<String, String> record = new HashMap<String, String>();
|
|
|
while (it.hasNext()) // loop for each function
|
|
while (it.hasNext()) // loop for each function
|
|
|
{
|
|
{
|
|
|
String field_name = (String) it.next();
|
|
String field_name = (String) it.next();
|
|
|
- String val = rec.getString(field_name).replace("\n", "");
|
|
|
|
|
|
|
+ String val = rec.getString(field_name)
|
|
|
|
|
+ .replace("\n", "");
|
|
|
record.put(field_name, val);
|
|
record.put(field_name, val);
|
|
|
}
|
|
}
|
|
|
records.add(record);
|
|
records.add(record);
|
|
@@ -697,10 +697,10 @@ public class ResultActivity extends Activity
|
|
|
return offset;
|
|
return offset;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public int get_direction()
|
|
|
|
|
- {
|
|
|
|
|
- return direction;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // public int get_direction()
|
|
|
|
|
+ // {
|
|
|
|
|
+ // return direction;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
public void set_offset(int i)
|
|
public void set_offset(int i)
|
|
|
{
|
|
{
|
|
@@ -708,47 +708,9 @@ public class ResultActivity extends Activity
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void set_direction(int i)
|
|
|
|
|
- {
|
|
|
|
|
- direction = i;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- // public int get_count()
|
|
|
|
|
- // {
|
|
|
|
|
- // return records.size();
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // public int get_fieldscount()
|
|
|
|
|
- // {
|
|
|
|
|
- // return fields.size();
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // private class record
|
|
|
|
|
- // {
|
|
|
|
|
- // HashMap<String,Object> values = ;
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
- // private class field
|
|
|
|
|
|
|
+ // public void set_direction(int i)
|
|
|
// {
|
|
// {
|
|
|
- // String name = null;
|
|
|
|
|
- // String aliasname = null;
|
|
|
|
|
- // String type = null;
|
|
|
|
|
- //
|
|
|
|
|
- // public String get_name()
|
|
|
|
|
- // {
|
|
|
|
|
- // return name;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // public String get_aliasname()
|
|
|
|
|
- // {
|
|
|
|
|
- // return aliasname;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // public String get_type()
|
|
|
|
|
- // {
|
|
|
|
|
- // return type;
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ // direction = i;
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
|
|
|