Пример #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_history);
    ButterKnife.inject(this);

    realm = Realm.getInstance(this);

    getSupportActionBar().setTitle("Riwayat Wisata");
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    locationModels = new ArrayList<>();
    adapterRoute = new ListRouteAdapter(this, locationModels);

    updateView();

    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(adapterRoute);
    recyclerView.addOnItemTouchListener(
        new RecyclerItemClickListener(this, this) {
          @Override
          public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {}
        });
    readDataFromDb();

    AdView mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().build();
    mAdView.loadAd(adRequest);
  }
Пример #2
0
 @Override
 protected void onResume() {
   super.onResume();
   readDataFromDb();
 }