package com.gs.apidemo;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.gs.account.entity.SipAccount;
import com.gs.phone.context.PhoneContext;
import com.gs.phone.entity.DialingInfo;

import java.util.List;

/*
 */
public class CustomIntentActivity extends BaseActivity {
    private static final String TAG = CustomIntentActivity.class.getSimpleName();
    private TextView actionTv, dialingInfoTv;
    private SipAccount mSelectedAccount = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_intent);
        mSelectedAccount = null;
        actionTv = (TextView) findViewById(R.id.tv_action);
        dialingInfoTv = (TextView) findViewById(R.id.tv_dialinginfo);
        Intent intent = getIntent();
        if (intent != null) {
            actionTv.setText("Action:" + intent.getAction());
            if (intent.hasExtra(PhoneContext.PhoneAction.KEY_DIAL_INFO_LIST)) {
                List<DialingInfo> list = intent.getParcelableArrayListExtra(PhoneContext.PhoneAction.KEY_DIAL_INFO_LIST);
                if (list != null) {
                    String str = "\nDialingInfo list:\n";
                    for (DialingInfo info : list) {
                        if (info == null) {
                            continue;
                        }
                        str += info.toString() + "\n";
                    }
                    dialingInfoTv.setText(str);
                }
            }
        }

    }

}
