Skip to content

Commit

Permalink
Merge pull request googlesamples#164 from tiembo/fix_warnings
Browse files Browse the repository at this point in the history
Fix warnings, remove unused imports, replace deprecated method.
  • Loading branch information
ianbarber committed Feb 11, 2016
2 parents d24f196 + 5fa2a17 commit 7d48f39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.app.Application;

import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Logger;
import com.google.android.gms.analytics.Tracker;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package com.google.samples.quickstart.analytics;


import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -65,7 +62,7 @@ public void onCreate(Bundle savedInstanceState) {
public View onCreateView(LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_main, null);
View view = inflater.inflate(R.layout.fragment_main, container, false);
ImageView imageView = (ImageView) view.findViewById(R.id.imageView);
imageView.setImageResource(resId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class MainActivity extends AppCompatActivity {
* The {@link android.support.v4.view.PagerAdapter} that will provide fragments for each image.
* This uses a {@link FragmentPagerAdapter}, which keeps every loaded fragment in memory.
*/
@SuppressWarnings("FieldCanBeLocal")
private ImagePagerAdapter mImagePagerAdapter;

/**
Expand Down Expand Up @@ -81,7 +82,7 @@ protected void onCreate(Bundle savedInstanceState) {
mViewPager.setAdapter(mImagePagerAdapter);

// When the visible image changes, send a screen view hit.
mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
mViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int position) {
sendScreenImageName();
Expand Down

0 comments on commit 7d48f39

Please sign in to comment.