@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View fa = getView();
ll = (LinearLayout)inflater.inflate(R.layout.chat_layout, container,false);
layoutToast = (TextView)fa.findViewById(R.id.layoutToast);
return ll;
//return inflater.inflate(R.layout.chat_layout, container, false);
if (!UtilChat.checkConnection(getActivity())){
UtilChat.initToast(getActivity(),"LOL", Toast.LENGTH_SHORT);
// finish();
}else{
bindViews();
verificaUsuarioLogado();
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.enableAutoManage(getActivity(), this)
.addApi(Auth.GOOGLE_SIGN_IN_API)
.build();
}
}
public class UtilChat {
public static final String URL_STORAGE_REFERENCE = "gs://korenovskguide-99b08.appspot.com";
public static final String FOLDER_STORAGE_IMG = "image";
public static void initToast(Context c, String message){
Toast.makeText(c,message,Toast.LENGTH_SHORT).show();
}
public static boolean checkConnection(Context context) {
boolean connection;
ConnectivityManager conectivtyManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
connection = conectivtyManager.getActiveNetworkInfo() != null
&& conectivtyManager.getActiveNetworkInfo().isAvailable()
&& conectivtyManager.getActiveNetworkInfo().isConnected();
return connection;
}
Проблема c:
UtilChat.initToast(getActivity(),"LOL", Toast.LENGTH_SHORT);
Ошибка:
Error:(125, 20) error: method initToast in class UtilChat cannot be applied to given types; required: Context,String found: FragmentActivity,String,int reason: actual and formal argument lists differ in length