Error: Unable to access jarfile %~dp0\apktool.jar
public void onClick(Object o) {
adapterStack.push(myAdapter);
if(o instanceof MapViewObject) {
//тут можно подгрузить данные и положить в адаптер
myAdapter = new FoodMenuAdapter(this,galleryList);
//prepareData();
}
if(o instanceof MapViewObject) {
//тут можно подгрузить данные и положить в адаптер
myAdapter = new FoodMenuAdapter(this,galleryList);
//prepareData();
};
if(o instanceof MapViewObject) {
//можно стартануть активити с покупкой
myAdapter = new FoodMenuAdapter(this,galleryList);
//prepareData();
};
recyclerView.setAdapter(myAdapter);
}
public void onClick(Object o) {
adapterStack.push(myAdapter);
if(o instanceof ViewObject) {
myAdapter = new Adapter1(this,galleryList);
}
if(o instanceof ViewObject) {
myAdapter = new Adapter2(this,galleryList);
};
if(o instanceof ViewObject) {
myAdapter = new Adapter3(this,galleryList);
};
recyclerView.setAdapter(myAdapter);
}
Cannot resolve method 'newInstance(java.lang.String)'
newInstance
. Пишет Cannot resolve method 'newInstance(java.lang.String)'
TestFragment newFragment = new TestFragment().newInstance("DataOne");
((AppCompatActivity) imageView.getContext()).getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, newFragment)
.addToBackStack(null)
.commit();
public static TestFragment newInstance(String line) {
TestFragment fragment = new TestFragment();
Bundle args = new Bundle();
args.putString("Data","DataOne");
fragment.setArguments(args);
return fragment;
}
TestFragment newFragment = new TestFragment();
Bundle args = new Bundle();
args.putString("Button", "DataOne");
newFragment.setArguments(args);
((AppCompatActivity) imageView.getContext()).getSupportFragmentManager().beginTransaction()
.replace(R.id.content_frame, newFragment)
.addToBackStack(null)
.commit();
private String text;
mRef = database.getReference(text);
if (getArguments() != null){
text = getArguments().getString("Button");
}
FirebaseRecyclerOptions<GalleryGridObject> options =
new FirebaseRecyclerOptions.Builder<GalleryGridObject>()
.setQuery(mRef, GalleryGridObject.class)
.build();
FirebaseRecyclerAdapter<GalleryGridObject, ViewHolder> firebaseRecyclerAdapter =
new FirebaseRecyclerAdapter<GalleryGridObject, ViewHolder>(options) {
@Override
protected void onBindViewHolder(@NonNull ViewHolder holder, int position, @NonNull GalleryGridObject model) {
holder.setDetails(getContext(), model.getImage());
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View itemView = LayoutInflater.from(viewGroup.getContext())
.inflate(R.layout.item_coupons, viewGroup, false);
return new ViewHolder(itemView);
}
};
recyclerView.setAdapter(firebaseRecyclerAdapter);
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_test_item, container, false);
fab = (FloatingActionButton) view.findViewById(R.id.fab);
cardView = (CardView) view.findViewById(R.id.map_cardview);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
fab.hide();
cardView.setVisibility(View.VISIBLE);
}
});
mRootView = (FrameLayout) view.findViewById(R.id.rootView);
mRootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
fab.show();
cardView.setVisibility(View.GONE);
}
});
return view;
}