I created an ImageView
with the hopes of it taking me from one activity to the next when clicked on.
I entered the following code but the compiler is saying:"error: cannot find symbol method findViewById(int)". If you could help me resolve this, I'd be very grateful.
My code:
package com.androidcodefinder.loginscreendemo.Catalysts;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.androidcodefinder.loginscreendemo.MainActivity;
import com.androidcodefinder.loginscreendemo.R;
import com.androidcodefinder.loginscreendemo.SignUpActivity;
import com.androidcodefinder.loginscreendemo.postpg;
public class AIFragment extends android.support.v4.app.Fragment {
private static final String TAG = "AIFragments";
private ImageView imageView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_ai, container, false);
return view;
imageView=(ImageView)findViewById(R.id.savage);
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getActivity(),postpg.class);
startActivity(intent);
}
});
}
}