android.app.Activity.onCreate()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(275)

本文整理了Java中android.app.Activity.onCreate()方法的一些代码示例,展示了Activity.onCreate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.onCreate()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:onCreate

Activity.onCreate介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
  }
}

代码示例来源:origin: androidannotations/androidannotations

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
}

代码示例来源:origin: androidannotations/androidannotations

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
}

代码示例来源:origin: androidannotations/androidannotations

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
}

代码示例来源:origin: androidannotations/androidannotations

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
}

代码示例来源:origin: androidannotations/androidannotations

@Trace
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
}

代码示例来源:origin: hdodenhof/CircleImageView

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
}

代码示例来源:origin: nostra13/Android-Universal-Image-Loader

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.ac_home);
  File testImageOnSdCard = new File("/mnt/sdcard", TEST_FILE_NAME);
  if (!testImageOnSdCard.exists()) {
    copyTestImageToSdCard(testImageOnSdCard);
  }
}

代码示例来源:origin: ReactiveX/RxAndroid

@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main_activity);
  findViewById(R.id.button_run_scheduler).setOnClickListener(new View.OnClickListener() {
    @Override public void onClick(View v) {
      onRunSchedulerExampleButtonClicked();
    }
  });
}

代码示例来源:origin: androidannotations/androidannotations

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  Bus bus = new Bus();
  bus.register(this);
}

代码示例来源:origin: androidannotations/androidannotations

@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setResult(RESULT_OK);
    finish();
  }
}

代码示例来源:origin: square/dagger

@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Perform injection so that when this call returns all dependencies will be available for use.
  ((DemoApplication) getApplication()).inject(this);
 }
}

代码示例来源:origin: android10/Android-CleanArchitecture

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 this.getApplicationComponent().inject(this);
}

代码示例来源:origin: square/leakcanary

@Override protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 if (savedInstanceState == null) {
  if (hasStoragePermission()) {
   finish();
   return;
  }
  String[] permissions = {
    WRITE_EXTERNAL_STORAGE
  };
  requestPermissions(permissions, 42);
 }
}

代码示例来源:origin: square/leakcanary

@Override protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main_activity);
 View button = findViewById(R.id.async_work);
 button.setOnClickListener(new View.OnClickListener() {
  @Override public void onClick(View v) {
   startAsyncWork();
  }
 });
 httpRequestHelper = (HttpRequestHelper) getLastNonConfigurationInstance();
 if (httpRequestHelper == null) {
  httpRequestHelper = new HttpRequestHelper(button);
 }
}

代码示例来源:origin: google/ExoPlayer

@Override
public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 requestWindowFeature(Window.FEATURE_NO_TITLE);
 setContentView(getResources().getIdentifier("host_activity", "layout", getPackageName()));
 surfaceView = findViewById(
   getResources().getIdentifier("surface_view", "id", getPackageName()));
 surfaceView.getHolder().addCallback(this);
}

代码示例来源:origin: google/ExoPlayer

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.main_activity);
 playerView = findViewById(R.id.player_view);
 player = new PlayerManager(this);
}

代码示例来源:origin: greenrobot/EventBus

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_runtests);
  textViewResult = findViewById(R.id.textViewResult);
  controlBus = new EventBus();
  controlBus.register(this);
}

代码示例来源:origin: google/ExoPlayer

@Override
public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 requestWindowFeature(Window.FEATURE_NO_TITLE);
 setContentView(getResources().getIdentifier("host_activity", "layout", getPackageName()));
 surfaceView = findViewById(
   getResources().getIdentifier("surface_view", "id", getPackageName()));
 surfaceView.getHolder().addCallback(this);
}

代码示例来源:origin: bumptech/glide

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 imageViewRes = (ImageView) findViewById(R.id.svg_image_view1);
 imageViewNet = (ImageView) findViewById(R.id.svg_image_view2);
 requestBuilder = GlideApp.with(this)
   .as(PictureDrawable.class)
   .placeholder(R.drawable.image_loading)
   .error(R.drawable.image_error)
   .transition(withCrossFade())
   .listener(new SvgSoftwareLayerSetter());
}

相关文章

Activity类方法