package org.xdty.example;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.TextView;

import org.xdty.phone.number.PhoneNumber;
import org.xdty.phone.number.model.Number;
import org.xdty.phone.number.model.NumberInfo;
import org.xdty.phone.number.model.ResponseHeader;

import java.util.List;

public class MainActivity extends AppCompatActivity {

    public final static String TAG = MainActivity.class.getSimpleName();

    TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = (TextView) findViewById(R.id.text);

        new PhoneNumber(this, new PhoneNumber.Callback() {
            @Override
            public void onResponseOffline(NumberInfo numberInfo) {
            }

            @Override
            public void onResponse(NumberInfo numberInfo) {
                // Do your jobs here
                textView.setText(numberInfo.toString());

                List<Number> numbers = numberInfo.getNumbers();
                for (Number number : numbers) {
                    Log.d(TAG, number.getNumber() +
                            ": " +
                            number.getType().getText() +
                            ", " +
                            number.getName() +
                            ", " +
                            number.getCount());
                }
            }

            @Override
            public void onResponseFailed(NumberInfo numberInfo) {
                if (numberInfo != null) {
                    ResponseHeader responseHeader = numberInfo.getResponseHeader();
                    if (responseHeader != null) {
                        textView.setText(responseHeader.getStatus());
                    }
                } else {
                    Log.e(TAG, "numberInfo is null");
                }
            }
        }).fetch("10086", "10000", "10001", "02151860253", "4001001673", "-1", "-2", "550", "551", "559", "569");
    }

}

@@ -234,137 +234,16 @@
 del.
+I
 Number;
-%0Aimport org.xdty.phone.number.model.NumberInfo;%0Aimport org.xdty.phone.number.model.ResponseHeader;%0A%0Aimport java.util.List;
 %0A%0Apu
@@ -736,37 +736,30 @@
 Offline(
+I
 Number
-Info
  number
-Info
 ) %7B%0A    
@@ -826,37 +826,30 @@
 esponse(
+I
 Number
-Info
  number
-Info
 ) %7B%0A    
@@ -901,192 +901,18 @@
     
-textView.setText(numberInfo.toString());%0A%0A                List%3CNumber%3E numbers = numberInfo.getNumbers();%0A                for (Number number : numbers) %7B%0A                    Log.d(TAG,
+String s =
  num
@@ -957,23 +957,15 @@
     
-  
-  
 %22: %22 +%0A
-    
     
@@ -1009,28 +1009,24 @@
 getText() +%0A
-    
             
@@ -1060,36 +1060,32 @@
                 
-    
 number.getName()
@@ -1103,36 +1103,32 @@
                 
-    
 %22, %22 +%0A         
@@ -1134,36 +1134,32 @@
                 
- 
-   
 number.getCount(
@@ -1159,18 +1159,18 @@
 tCount()
-);
+ +
 %0A       
@@ -1174,34 +1174,32 @@
             
-%7D%0A
         
     %7D%0A%0A     
@@ -1178,38 +1178,39 @@
                 
-    %7D%0A
+%22 : %22 +
 %0A            @Ov
@@ -1202,34 +1202,24 @@
             
-@Override%0A
             
@@ -1222,408 +1222,247 @@
     
-public void onResponseFailed(NumberInfo numberInfo) %7B%0A                if (numberInfo != null) %7B%0A                    ResponseHeader responseHeader = numberInfo.getResponseHeader();%0A                    if (responseHeader != null) %7B%0A                        textView.setText(responseHeader.getStatus());%0A                    %7D%0A                %7D else %7B%0A                    Log.e(TAG, %22numberInfo is null%22);
+number.getProvince() + %22 %22 + number.getCity() + %22 %22 + number.getProvider();%0A                textView.setText(s);%0A                Log.d(TAG, s);%0A            %7D%0A%0A            @Override%0A            public void onResponseFailed(INumber number) %7B
 %0A   
@@ -1462,36 +1462,32 @@
 ) %7B%0A            
-    
 %7D%0A            %7D%0A
@@ -1484,31 +1484,38 @@
     
-    %7D%0A        %7D).fetch(
+%7D).fetch(%2210086%22);%0A        // 
 %22100
@@ -1604,18 +1604,16 @@
 %22, %22569%22
-);
 %0A    %7D%0A%0A

update example