@@ -0,0 +1,3169 @@
+package lucene.hurricanc.com.wjlucene_android;%0A%0A/**%0A * Created by Hurricanc on 11/4/15.%0A */%0A%0Aimport android.app.ActionBar;%0Aimport android.app.Activity;%0Aimport android.content.Intent;%0Aimport android.graphics.Color;%0Aimport android.net.Uri;%0Aimport android.os.Bundle;%0Aimport android.util.Log;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0Aimport android.widget.Button;%0Aimport android.widget.LinearLayout;%0Aimport android.widget.TableLayout;%0Aimport android.widget.TableRow;%0Aimport android.widget.TextView;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0Aimport org.json.JSONObject;%0A%0Apublic class ResultActivity extends Activity %7B%0A%0A    @Override%0A    public void onCreate(Bundle savedInstanceState) %7B%0A%0A        super.onCreate(savedInstanceState);%0A        setContentView(R.layout.result_main);%0A%0A        Button backButton = (Button) findViewById(R.id.backButton);%0A        backButton.setOnClickListener(new View.OnClickListener() %7B%0A            public void onClick(View v) %7B%0A                onBackPressed();%0A            %7D%0A        %7D);%0A%0A        Intent intent = getIntent();%0A        String value = intent.getExtras().getString(%22key%22);%0A%0A        JSONObject obj = null;%0A        try %7B%0A            obj = new JSONObject(value);%0A            JSONArray newsArray = new JSONArray();%0A            newsArray = obj.getJSONArray(%22News%22);%0A%0A%0A            for (int i = 0; i %3C newsArray.length(); i++) %7B%0A%0A                JSONObject News = newsArray.getJSONObject(i);%0A                String title = News.getString(%22Title%22);%0A                String number = News.getString(%22Number%22);%0A                String URL = News.getString(%22URL%22);%0A%0A                Log.v(%22WOOJNUM%22, number);%0A%0A                this.setFirstBlock(number, URL);%0A            %7D%0A%0A        %7D catch (JSONException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    private void setFirstBlock(String number, final String url) %7B%0A        TableLayout tableView = (TableLayout) findViewById(R.id.tableLayout1);%0A        Button btn = new Button(this);%0A        btn.setText(%22NEWS NUMBER: %22 + number);%0A        btn.setBackgroundColor(0xE6FAFF);%0A        btn.setOnClickListener(new View.OnClickListener() %7B%0A            public void onClick(View v) %7B%0A                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));%0A                startActivity(browserIntent);%0A            %7D%0A        %7D);%0A        //TableLayout.LayoutParams lp = new TableLayout.LayoutParams(tableView.getLayoutParams());%0A        tableView.addView(btn);%0A    %7D%0A%0A    private View tableChild(String number, final String URL) %7B%0A%0A        TableRow tr = new TableRow(this);%0A        View v = LayoutInflater.from(this).inflate(R.layout.custom_tablerow, tr, true);%0A        TextView tv = (TextView) v.findViewById(R.id.title);%0A        tv.setText(%22NEWS NUMBER: %22 + number);%0A        Button btn = (Button) v.findViewById(R.id.openURL);%0A        btn.setOnClickListener(new View.OnClickListener() %7B%0A            public void onClick(View v) %7B%0A                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(URL));%0A                startActivity(browserIntent);%0A            %7D%0A        %7D);%0A        return v;%0A    %7D%0A%0A%7D

Handle JSON Result Object in TableLayout