This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
private int currentIndex; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
currentIndex = savedInstanceState.getInt("currentIndex"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MasterActivity extends AppCompatActivity { | |
private MainViewModel viewModel; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
viewModel = ViewModelProviders.of(this).get(MainViewModel.class); | |
viewModel.load(savedInstanceState); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MasterActivity extends AppCompatActivity { | |
private MainViewModel viewModel; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
viewModel = ViewModelProviders.of(this).get(MainViewModel.class); | |
if (savedInstanceState != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.v7.app.AppCompatActivity; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StorageIntroAdapter extends RecyclerView.Adapter<StorageIntroAdapter.ViewHolder> { | |
private final LayoutInflater inflater; | |
private final List<StorageOption> data; | |
private int selectedPosition; | |
private Consumer<Integer> onSelectionChangedListener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StorageIntroAdapter extends BaseAdapter { | |
private final LayoutInflater inflater; | |
private final List<StorageOption> data; | |
public StorageIntroAdapter(LayoutInflater inflater, List<StorageOption> data) { | |
this.inflater = inflater; | |
this.data = data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
ListView listView; | |
MyAdapter adapter; | |
List<MyData> data; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.pc.tictactoy | |
import android.graphics.Color | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.view.View | |
import android.widget.ArrayAdapter | |
import android.widget.Button | |
import android.widget.Toast | |
import x.android.synthetic.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model; | |
public class Board { | |
private final Piece[][] cells; | |
public Board(int width, int height) { | |
cells = new Piece[width][height]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FooDAO implements Closeable { | |
private final Realm realm = Realm.getDefaultInstance(); | |
@Override | |
public void close() { | |
realm.close(); | |
} | |
public void setFooValue(RealmFoo foo, String value) { |
OlderNewer