Note that there are some explanatory texts on larger screens.

plurals
  1. POcreating another Oncreate in same activity
    primarykey
    data
    text
    <p>I'm trying to add a second onCreate but when I did it it is not working , the first one which is <code>Oncreate</code> works well when I press the <code>TextView</code> it does the job and takes me to SecondActivity but when I press on the second one which calls <code>Oncreate1</code> it doesn't do the job for me and takes me to FirstActivity even though i did the exact same thing I did for the <code>Oncreate</code> I don't know what's the problem I hope you can help me</p> <p>This is the logcat</p> <pre><code> 12-26 04:13:27.390: I/Ads(1808): Ad url modified to http://googleads.g.doubleclick.net:80/mads/gma?preqs=0&amp;session_id=7802952340037714008&amp;seq_num=1&amp;u_w=384&amp;msid=imamalsajadsayings.android.com&amp;cap=m%2Ca&amp;js=afma-sdk-a-v6.4.1&amp;bas_off=0&amp;net=ed&amp;app_name=3.android.imamalsajadsayings.android.com&amp;hl=en&amp;gnt=3&amp;carrier=310260&amp;u_audio=4&amp;kw&amp;u_sd=2&amp;ms=MMbiAdsTBWDvSdyekwxcU1HfnPY0zVDgymfntXc0HtctkjVkiQVLwpyucG2sYhOjA-oCD3ttwEUCEaLiC7z810qPte8UcMBibTH6mFdmFZpFqMtfE-ZQ-qbdeoxgUiVSgJYqK4bpoDU_WFa3wexgrJAYtMktIhKFa_6IELwlqNqTS157Vrm5Cv-95PJq-kHr-EorriTQzyw0HE_eBM5KrLg2JcAZwS1uXPDGOehjdapmAyJ7FZJ_YTg1Vr85Ux94RIqrdwPvOiLW1BzOFEtNtmMmsb47xAjv-fEYOrG_0DnHIwK-CXcnifK8wHi2RTSkWyNxiIqxPc6RNxvG7GD8Ww&amp;format=320x50_mb&amp;oar=0&amp;u_h=592&amp;bas_on=0&amp;ptime=0&amp;imbf=8008&amp;u_so=p&amp;output=html&amp;region=mobile_app&amp;u_tz=-300&amp;client_sdk=1&amp;ex=1&amp;slotname=a152b5665edfefd&amp;kw_type=broad&amp;gsb=3g&amp;caps=inlineVideo_interactiveVideo_mraid1_th_autoplay_mediation_sdkAdmobApiForAds_di&amp;jsv=66&amp;urll=909 12-26 04:13:27.390: I/Ads(1808): Request scenario: Online server request. 12-26 04:13:31.650: W/EGL_emulation(1808): eglSurfaceAttrib not implemented 12-26 04:13:31.890: I/Choreographer(1808): Skipped 34 frames! The application may be doing too much work on its main thread. 12-26 04:13:35.060: I/Choreographer(1808): Skipped 75 frames! The application may be doing too much work on its main thread. 12-26 04:13:37.470: W/EGL_emulation(1808): eglSurfaceAttrib not implemented 12-26 04:13:38.380: I/Ads(1808): onReceiveAd() 12-26 04:13:39.140: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000b44 12-26 04:13:39.180: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000bd0 12-26 04:13:39.400: I/chromium(1808): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 12-26 04:13:40.010: I/chromium(1808): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 12-26 04:13:40.170: E/eglCodecCommon(1808): **** ERROR unknown type 0x0 (glSizeof,72) 12-26 04:13:40.550: I/Choreographer(1808): Skipped 86 frames! The application may be doing too much work on its main thread. 12-26 04:13:40.590: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000b44 12-26 04:13:40.610: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000bd0 12-26 04:13:40.870: E/eglCodecCommon(1808): **** ERROR unknown type 0x0 (glSizeof,72) 12-26 04:13:41.300: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000b44 12-26 04:13:41.310: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000bd0 12-26 04:13:41.390: E/eglCodecCommon(1808): **** ERROR unknown type 0x0 (glSizeof,72) 12-26 04:13:41.520: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000b44 12-26 04:13:41.560: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000bd0 12-26 04:13:41.740: E/eglCodecCommon(1808): **** ERROR unknown type 0x0 (glSizeof,72) 12-26 04:13:41.830: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000b44 12-26 04:13:41.850: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000bd0 12-26 04:13:41.910: E/eglCodecCommon(1808): **** ERROR unknown type 0x0 (glSizeof,72) 12-26 04:13:42.070: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000b44 12-26 04:13:42.090: E/eglCodecCommon(1808): glUtilsParamSize: unknow param 0x00000bd0 </code></pre> <p>.<br> and this is the <code>MainActivity</code> </p> <pre><code>package imamalsajadsayings.android.com; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.TextView; public class MainActivity extends Activity { private TextView mTextView; private TextView mTextView1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTextView = (TextView) findViewById( R.id.state2 ); mTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(MainActivity.this,SecondActivity.class); startActivity(i); } }); } protected void onCreate1(Bundle savedInstanceState) super.onCreate(savedInstanceState); mTextView1 = (TextView) findViewById( R.id.state1 ); mTextView1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(MainActivity.this,FirstActivity.class); startActivity(i); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items TO the action bar IF it IS present. getMenuInflater().inflate(R.menu.main, menu); return true; } } </code></pre> <p>I wish you can help me to make <code>Oncreate1</code> works too....</p> <p>Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload