// Path: app/src/main/java/com/me/silencedut/nbaplus/app/App.java
// public class App extends Application {
//     private static Application sInstance;
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         FIR.init(this);
// //        mRefWatcher = LeakCanary.install(this);
//         sInstance = this;
//         AppService.getInstance().initService();
// 
//     }
//     public static Context getContext() {
//         return sInstance.getApplicationContext();
//     }
// 
// }


import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Color;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.TextView;
import com.me.silencedut.nbaplus.R;
import com.me.silencedut.nbaplus.app.App;
package com.me.silencedut.nbaplus.utils;





/**
 * Created by SilenceDut on 2015/12/11.
 */
public class AppUtils {

    public static String getVersionName(Context context) {
        String versionName = null;
        try {
            versionName = context.getApplicationContext().getPackageManager()
                    .getPackageInfo(context.getApplicationContext().getPackageName(), 0).versionName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return versionName;
    }


    public static void showSnackBar(View view,int id) {
// Path: app/src/main/java/com/me/silencedut/nbaplus/app/App.java
// public class App extends Application {
//     private static Application sInstance;
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         FIR.init(this);
// //        mRefWatcher = LeakCanary.install(this);
//         sInstance = this;
//         AppService.getInstance().initService();
// 
//     }
//     public static Context getContext() {
//         return sInstance.getApplicationContext();
//     }
// 
// }


// Path: app/src/main/java/com/me/silencedut/nbaplus/utils/AppUtils.java
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Color;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.TextView;
import com.me.silencedut.nbaplus.R;
import com.me.silencedut.nbaplus.app.App;

package com.me.silencedut.nbaplus.utils;





/**
 * Created by SilenceDut on 2015/12/11.
 */
public class AppUtils {

    public static String getVersionName(Context context) {
        String versionName = null;
        try {
            versionName = context.getApplicationContext().getPackageManager()
                    .getPackageInfo(context.getApplicationContext().getPackageName(), 0).versionName;
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return versionName;
    }


    public static void showSnackBar(View view,int id) {
        Resources resources  =App.getContext().getResources();