第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

安卓開發(fā)onclicklistener中,findinbyview為何Button cannot be resolved a type?

安卓開發(fā)onclicklistener中,findinbyview為何Button cannot be resolved a type?

mongoos 2015-07-24 18:12:09
問題如上,包我也導(dǎo)入了。package com.example.second;import android.widget.*;import android.app.Activity;import android.os.Bundle;import android.view.Menu;import android.widget.Button;import android.widget.CompoundButton.OnCheckedChangeListener;public class MainActivity extends Activity {? ?? private Button loginButton;? ? @Override? ? protected void onCreate(Bundle savedInstanceState) {? ? ? ? super.onCreate(savedInstanceState);? ? ? ? setContentView(R.layout.activity_main);? ? ? ? loginButton=findViewById(R.id.button1);? ? ? ??? ? ? ??? ? ? ??? ? }? ? @Override? ? public boolean onCreateOptionsMenu(Menu menu) {? ? ? ? // Inflate the menu; this adds items to the action bar if it is present.? ? ? ? getMenuInflater().inflate(R.menu.activity_main, menu);? ? ? ? return true;? ? }? ??}xml如下<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"? ? xmlns:tools="http://schemas.android.com/tools"? ? android:layout_width="match_parent"? ? android:layout_height="match_parent"? ? tools:context=".MainActivity" >? ? <Button? ? ? ? android:id="@+id/button1"? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:layout_alignParentLeft="true"? ? ? ? android:layout_alignParentTop="true"? ? ? ? android:text="Button" /></RelativeLayout>
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1400 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)