0

I got a problem when I navigate between two activities, it shows me error and I don't know what is the problem. I am very sure that my code is correct, because it just simple Intent navigate by on click Button.

When I Press the button to go to the next activity it returns me to the fist activity (not the desire one). Note that both activity has background image. Fist Activity

public class firstActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.first_activity);//has a background img and one button


}
public void nextPage(View view){
    Intent StartNewActivity = new Intent(firstActivity.this, secondActivity.class);
    startActivity(StartNewActivity);
    overridePendingTransition(R.layout.slide_in_up, R.layout.slide_out_up);

}

}

Second Activity

public class secondActivity extends AppCompatActivity {

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.second_activity);// has a background img and one button


}
public void nextPage(View view){
    Intent StartNewActivity = new Intent(secondActivity.this, thirdActivity.class);
    startActivity(StartNewActivity);
    overridePendingTransition(R.layout.slide_in_up, R.layout.slide_out_up);

}

}

This is the error message Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering

Also, I did not use any ripple drawable in my app.Even though I don't know what does it mean?

Thanks,

Fatimah Mohmmed
  • 147
  • 2
  • 18
  • Clean and Rebuild your project. – iMDroid Sep 23 '16 at 05:24
  • I already did this many times and it does not work. I searched and I found somethings about leak memory and the size of background pictures. But I don't know what to do excatuly? – Fatimah Mohmmed Sep 23 '16 at 06:44
  • Did u add support v7 compact dependency in your _build.gradle_ file? – Piyush Sep 23 '16 at 06:49
  • Yes, I had these two support compact, compile 'com.android.support:appcompat-v7:24.0.0' and compile 'com.android.support:support-v4:24.0.0'. I am using compileSdkVersion 24. – Fatimah Mohmmed Sep 23 '16 at 12:31
  • I am getting this error now !! Out of memory on a 3481292-byte allocation. Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 884 (fundapplication) – Fatimah Mohmmed Sep 23 '16 at 13:11

3 Answers3

0

Something you have wants to to find a refwrence to that ripple component, you need to find out what.

Otherwise, you can try to make sure you have added a reference to the support.v7.widget in the second activity and see if the exception goes away.

Aside from that, we would need to see more code to help further.

Michael Bedford
  • 1,742
  • 20
  • 48
0

When I Press the button to go to the next activity it returns me to the fist activity (not the desire one)

It means that your app crashes when loading your new activity, so it comes back the first one.

Check your activity layout, style configuration => clean your project => Run again. Hope it can help.

Quang Nguyen
  • 2,600
  • 2
  • 17
  • 24
0

I solved my problem by resizing the background images of the activities, and I added this extra attribute in the manifests file

<application
    android:largeHeap="true" >

</application>
Fatimah Mohmmed
  • 147
  • 2
  • 18