app/src/main/java/org/andstatus/app/origin/OriginList.java
/**
     * Change the Activity according to the new intent. This procedure is done
     * both {@link #onCreate(Bundle)} and {@link #onNewIntent(Intent)}
     */
Change the Activity according to the new intent.
Change the Activity according to the new intent .
private void processNewIntent(Intent intentNew) {
        String action = intentNew.getAction();
        if (Intent.ACTION_PICK.equals(action) || Intent.ACTION_INSERT.equals(action)) {
            getListView().setOnItemClickListener(this::onPickOrigin);
        } else {
            getListView().setOnItemClickListener(this::onEditOrigin);
        }
        addEnabled = !Intent.ACTION_PICK.equals(action);
        originType = OriginType.fromCode(intentNew.getStringExtra(IntentExtra.ORIGIN_TYPE.key));
        if (Intent.ACTION_INSERT.equals(action)) {
            getSupportActionBar().setTitle(R.string.select_social_network);
        }
        ListAdapter adapter = new MySimpleAdapter(this,
                data,
                R.layout.origin_list_item,
                new String[] {KEY_VISIBLE_NAME, KEY_NAME},
                new int[] {R.id.visible_name, R.id.name}, true);
        setListAdapter(adapter);
        fillList();
    }
private void processNewIntent ( Intent intentNew ) { String action = intentNew . getAction ( ) ; if ( Intent . ACTION_PICK . equals ( action ) || Intent . ACTION_INSERT . equals ( action ) ) { getListView ( ) . setOnItemClickListener ( this :: onPickOrigin ) ; } else { getListView ( ) . setOnItemClickListener ( this :: onEditOrigin ) ; } addEnabled = ! Intent . ACTION_PICK . equals ( action ) ; originType = OriginType . fromCode ( intentNew . getStringExtra ( IntentExtra . ORIGIN_TYPE . key ) ) ; if ( Intent . ACTION_INSERT . equals ( action ) ) { getSupportActionBar ( ) . setTitle ( R . string . select_social_network ) ; } ListAdapter adapter = new MySimpleAdapter ( this , data , R . layout . origin_list_item , new String [ ] { KEY_VISIBLE_NAME , KEY_NAME } , new int [ ] { R . id . visible_name , R . id . name } , true ) ; setListAdapter ( adapter ) ; fillList ( ) ; }
Change the Activity according to the new intent.
Change the Activity according to the new intent .
// Bind to our new adapter.