بروز خطا
[message]
اشتراک در سوال
رای ها
[dataList]
مشکلم با btn
سلام اگه میشه لطفا راهنمایی کنید مشکل این چیه(حل شد)
package mohammadi.yasin.app;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
public class MyStarup4Activity extends Activity {
public int Counter = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView txtCaption = (TextView) findViewById(R.id.txtCaption);
final Button btnChangeVisibility = (Button) findViewById(R.id.btnChangeVisibility);
for (int i = 0; i < 2; i++) {
Toast.makeText(MyStarup4Activity.this, "Some Massege " + i, Toast.LENGTH_SHORT).show();
txtCaption.setText("I is: " + i);
}
txtCaption.setTextColor(Color.parseColor("#00ff00"));
txtCaption.setBackgroundColor(Color.parseColor("#7f7f7f"));
txtCaption.setTextSize(40);
//txtCaption.setVisibility(View.GONE);
txtCaption.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Log.i("LOG", "View Text Clicked");
Toast.makeText(MyStarup4Activity.this, "Text View Clicked", Toast.LENGTH_SHORT).show();
Counter++;
txtCaption.setText("Counter is: " + Counter);
}
});
btnChangeVisibility.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Log.i("LOG", "View Text Clicked");
Toast.makeText(MyStarup4Activity.this, "Text View Clicked", Toast.LENGTH_SHORT).show();
Counter++;
txtCaption.setText("Counter is: " + Counter);
}
});
}
}
0
0
خب پیام خطایی که براتون اومده چیه. اونو بذار. (9 سال پیش)
0
0
مشکلتون دقیقا کجاست ؟ چه خطایی میگیره ؟ باتن btnChangeVisibility که ویزیبیلیتی رو تغییر نمیده اصلا اینجا!. اگه میخواین تغییرش بده باید با متد ()getVisibility این کار رو انجام بدین . (9 سال پیش)
برای این سوال 3 پاسخ وجود دارد.
پاسخ به سوال
Lion and the rabbit
9 سال پیش
0
0
نمیدونم ولی وقتی کامپیوتر رو خاموش کردم و بعد از یه مدت روشن کردم دیگه ازم خطا نگرفت!
پاسخ به سوال
Lion and the rabbit
9 سال پیش
0
0
وقتی هم که دیگه خطا نگرفت دیگه با اف5 نرم افزارم تو امولیتور بالا نیومد و پیغام has stoped رو میده
پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .
