public class MainActivity extends Activity {
private Button btn;
private TextView tv;
Context context;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn = (Button)findViewById(R.id.btn1);
tv = (TextView)findViewById(R.id.tv1);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if( v == btn )
{
exec_post();
}
}
});
}
private void exec_post() {
HttpPostTask task = new HttpPostTask(
this"http://localhost/android/test.php";new HttpPostHandler(){
public void onPostCompleted(String response) {
tv.setText( response );
}
public void onPostFailed(String response) {
tv.setText( response );
Toast.makeText(
getApplicationContext(),
Toast.LENGTH_LONG
).show();
}
}
);
task.addPostParam( "post_1", "zxc" );
task.addPostParam( "post_2", "asdddド" );
task.execute();
}
public abstract class HttpPostHandler extends Handler {
public void handleMessage(Message msg)
{
boolean isPostSuccess = msg.getData().getBoolean("http_post_success");
String http_response = msg.getData().get("http_response").toString(); i
f( isPostSuccess )
{
onPostCompleted( http_response );
}
else
{
onPostFailed( http_response );
}
}
public abstract void onPostCompleted( String response );
public abstract void onPostFailed( String response );
}
public class HttpPostTask extends AsyncTask<Void, Void, Void> {
private String request_encoding = "UTF-8";
private String response_encoding = "UTF-8";
private Activity parent_activity = null;
private String post_url = null;
private Handler ui_handler = null;
private List<NameValuePair> post_params = null;


07-02 07:34:35.279: W/ResourceType(32347): Failure getting entry for 0x010802c1 (t=7 e=705) in package 0 (error -75)
이거 에러가 왜날까요 ㅠ
동작하는건 문제가 없는데.. 에러가 나서.... (버전은 4.1버전 쓰고있습니다)
그리고... php에서 배열값같은거 받아올때 무엇을 쓰면 좋을까요 참고할 사이트가 있으면 가르쳐 주시면 감사드려요