[Solved] How to open an Image from on Itemclick listener

[ad_1]

Your error itself gives answer of your question.

requestFeature() must be called before adding content

That means your second Activity needs this change

requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main4);

requestWindowFeature() must be before setContentView()

After your updated question

now your error is

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)' on a null object reference

you need to check this What is a Null Pointer Exception, and how do I fix it?

[ad_2]

solved How to open an Image from on Itemclick listener