|
|
@@ -26,6 +26,7 @@ import android.view.Menu;
|
|
|
import android.view.MenuItem;
|
|
|
import android.view.View;
|
|
|
import android.widget.Button;
|
|
|
+import android.widget.TableLayout;
|
|
|
import android.widget.TableRow;
|
|
|
import android.widget.TextView;
|
|
|
import android.widget.Toast;
|
|
|
@@ -196,6 +197,8 @@ public class ResultActivity extends Activity
|
|
|
if (ret >= 0)
|
|
|
{
|
|
|
searchresult.put_totalcount(ret);
|
|
|
+ if(ret==0)
|
|
|
+ return true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -221,11 +224,15 @@ public class ResultActivity extends Activity
|
|
|
if (searchresult.get_fieldscount() == 0)
|
|
|
{
|
|
|
JSONObject objfields = jsobj.getJSONObject("fields");
|
|
|
- searchresult.init_fields(objfields.toString());
|
|
|
+ if(objfields!=null)
|
|
|
+ searchresult.init_fields(objfields.toString());
|
|
|
}
|
|
|
JSONObject objrecords = jsobj.getJSONObject("records");
|
|
|
- searchresult.add_records(objrecords.toString());
|
|
|
+ if(objrecords!=null)
|
|
|
+ searchresult.add_records(objrecords.toString());
|
|
|
errorcode = Network.RESULT_TRUE;
|
|
|
+
|
|
|
+
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
@@ -285,6 +292,24 @@ public class ResultActivity extends Activity
|
|
|
|
|
|
TextView tv_head = (TextView) findViewById(R.id.tv_head);
|
|
|
tv_head.setText(searchresult.get_totalcount()+"");
|
|
|
+// // 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);
|