if(message!=null){

char[] Char=message.substring(0,1).toCharArray();
char OneChar=Char[0];
if(OneChar=='{'){
try {
Log.e("No Array","Is Object");

}

catch (Exception e) {
Toast.makeText(context, "JSon error",Toast.LENGTH_SHORT ).show();
Log.d(TAG,"parse message as json exception "+e);
}

}
else if(OneChar=='['){
try {
Log.e("Is Array","No Object");

}catch(Exceptione){
// TODO: handle exception
}}
else{//不是JsonArray 也不是JsonObject

Log.e("No Array","No Object");

}


}





arrow
arrow
    全站熱搜

    小彬彬 發表在 痞客邦 留言(0) 人氣()