SlideShare a Scribd company logo
1 of 2
Download to read offline
NB. Explain Every Line Of Code
public class MainActivity extends AppCompatActivity {
Button b1, b2;
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1 = (Button) findViewById(R.id.button);
b2 = (Button) findViewById(R.id.button2);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setMessage("Loading..."); // Setting Message
progressDialog.setTitle("ProgressDialog"); // Setting Title
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); // Progress Dialog Style
Spinner
progressDialog.show(); // Display Progress Dialog
progressDialog.setCancelable(false); new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(10000);
} catch (Exception e) {
e.printStackTrace();
}
progressDialog.dismiss();
}
}).start();
}
});
b2.setOnClickListener(new View.OnClickListener() {
Handler handle = new Handler() {
public void handleMessage(Message msg) {
super.handleMessage(msg); progressDialog.incrementProgressBy(2); // Incremented By Value 2
} };
@Override
public void onClick(View v) {
progressDialog = new ProgressDialog(MainActivity.this);
progressDialog.setMax(100); // Progress Dialog Max Value
progressDialog.setMessage("Loading..."); // Setting Message
progressDialog.setTitle("ProgressDialog"); // Setting Title
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); // Progress Dialog Style
Horizontal
progressDialog.show(); // Display Progress Dialog
progressDialog.setCancelable(false); new Thread(new Runnable() {
@Override
public void run() {
try {
while (progressDialog.getProgress() <= progressDialog.getMax()) {
Thread.sleep(200);
handle.sendMessage(handle.obtainMessage());
if (progressDialog.getProgress() == progressDialog.getMax()) {
progressDialog.dismiss();
}
} }
catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
});
}
}

More Related Content

Similar to NB Explain Every Line Of Code public class MainActivity.pdf

Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android DevelopmentJussi Pohjolainen
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversUtkarsh Mankad
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesSamsung Developers
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfvenkt12345
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaDroidConTLV
 
Hi AndroidAnnotations
Hi AndroidAnnotationsHi AndroidAnnotations
Hi AndroidAnnotationsTsung-Yeh Lee
 
step by step to write a gnome-shell extension
step by step to write a gnome-shell extension step by step to write a gnome-shell extension
step by step to write a gnome-shell extension Yuren Ju
 
Foundational Facebook Marketing
Foundational Facebook MarketingFoundational Facebook Marketing
Foundational Facebook MarketingBlitzMetrics
 

Similar to NB Explain Every Line Of Code public class MainActivity.pdf (20)

Androidppt 1
Androidppt 1Androidppt 1
Androidppt 1
 
React outbox
React outboxReact outbox
React outbox
 
HNUH
HNUHHNUH
HNUH
 
Quick Intro to Android Development
Quick Intro to Android DevelopmentQuick Intro to Android Development
Quick Intro to Android Development
 
Android wear (coding)
Android wear (coding)Android wear (coding)
Android wear (coding)
 
Practical
PracticalPractical
Practical
 
Android crashcourse
Android crashcourseAndroid crashcourse
Android crashcourse
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
package org dev
package org devpackage org dev
package org dev
 
Package org dev
Package org devPackage org dev
Package org dev
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and Gestures
 
Ios - Introduction to platform & SDK
Ios - Introduction to platform & SDKIos - Introduction to platform & SDK
Ios - Introduction to platform & SDK
 
Android development
Android developmentAndroid development
Android development
 
Scrollable Demo App
Scrollable Demo AppScrollable Demo App
Scrollable Demo App
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
 
Building Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice NinjaBuilding Apps with Flutter - Hillel Coren, Invoice Ninja
Building Apps with Flutter - Hillel Coren, Invoice Ninja
 
Hi AndroidAnnotations
Hi AndroidAnnotationsHi AndroidAnnotations
Hi AndroidAnnotations
 
step by step to write a gnome-shell extension
step by step to write a gnome-shell extension step by step to write a gnome-shell extension
step by step to write a gnome-shell extension
 
Foundational Facebook Marketing
Foundational Facebook MarketingFoundational Facebook Marketing
Foundational Facebook Marketing
 
Android 3
Android 3Android 3
Android 3
 

More from aceindustriesjal

Assignment Case Study D GovEDex Disclaimer The situation .pdf
Assignment Case Study D  GovEDex Disclaimer The situation .pdfAssignment Case Study D  GovEDex Disclaimer The situation .pdf
Assignment Case Study D GovEDex Disclaimer The situation .pdfaceindustriesjal
 
El Sr Reber pens que la Sra Bissett era la empleada ideal.pdf
El Sr Reber pens que la Sra Bissett era la empleada ideal.pdfEl Sr Reber pens que la Sra Bissett era la empleada ideal.pdf
El Sr Reber pens que la Sra Bissett era la empleada ideal.pdfaceindustriesjal
 
B find the marginal Pmf of X and Y C find the covarianc.pdf
B find the marginal Pmf of X and Y  C find the covarianc.pdfB find the marginal Pmf of X and Y  C find the covarianc.pdf
B find the marginal Pmf of X and Y C find the covarianc.pdfaceindustriesjal
 
Billie Jackson was the leader of a nonprofit economic devel.pdf
Billie Jackson was the leader of a nonprofit economic devel.pdfBillie Jackson was the leader of a nonprofit economic devel.pdf
Billie Jackson was the leader of a nonprofit economic devel.pdfaceindustriesjal
 
a Construct a 95 confidence interval estimate for the popu.pdf
a Construct a 95 confidence interval estimate for the popu.pdfa Construct a 95 confidence interval estimate for the popu.pdf
a Construct a 95 confidence interval estimate for the popu.pdfaceindustriesjal
 
Dalez Corporation prepared the following two statements of e.pdf
Dalez Corporation prepared the following two statements of e.pdfDalez Corporation prepared the following two statements of e.pdf
Dalez Corporation prepared the following two statements of e.pdfaceindustriesjal
 
create a report 57 sentences executive summary and introd.pdf
create a report 57 sentences  executive summary and introd.pdfcreate a report 57 sentences  executive summary and introd.pdf
create a report 57 sentences executive summary and introd.pdfaceindustriesjal
 
a Which of the following statements is true Project teams.pdf
a Which of the following statements is true  Project teams.pdfa Which of the following statements is true  Project teams.pdf
a Which of the following statements is true Project teams.pdfaceindustriesjal
 
Sutural bone Also called Wormian bone Line Found in the me.pdf
Sutural bone  Also called Wormian bone Line  Found in the me.pdfSutural bone  Also called Wormian bone Line  Found in the me.pdf
Sutural bone Also called Wormian bone Line Found in the me.pdfaceindustriesjal
 
Church amp Dwight a large producer of sodium bicarbonate.pdf
Church amp Dwight a large producer of sodium bicarbonate.pdfChurch amp Dwight a large producer of sodium bicarbonate.pdf
Church amp Dwight a large producer of sodium bicarbonate.pdfaceindustriesjal
 
Think as if you are working in the Scottish Government or fo.pdf
Think as if you are working in the Scottish Government or fo.pdfThink as if you are working in the Scottish Government or fo.pdf
Think as if you are working in the Scottish Government or fo.pdfaceindustriesjal
 
The information that follows pertains to Esther Food Product.pdf
The information that follows pertains to Esther Food Product.pdfThe information that follows pertains to Esther Food Product.pdf
The information that follows pertains to Esther Food Product.pdfaceindustriesjal
 
Suppose the nation of Isoland is an importer of textiles and.pdf
Suppose the nation of Isoland is an importer of textiles and.pdfSuppose the nation of Isoland is an importer of textiles and.pdf
Suppose the nation of Isoland is an importer of textiles and.pdfaceindustriesjal
 
Respuesta poca del ao Duracin del da en horas .pdf
Respuesta   poca del ao   Duracin del da  en horas   .pdfRespuesta   poca del ao   Duracin del da  en horas   .pdf
Respuesta poca del ao Duracin del da en horas .pdfaceindustriesjal
 
Find the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdfFind the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdfaceindustriesjal
 
2 Short answer What is the relationship between the nomina.pdf
2 Short answer What is the relationship between the nomina.pdf2 Short answer What is the relationship between the nomina.pdf
2 Short answer What is the relationship between the nomina.pdfaceindustriesjal
 
During a recession median income falls by 20 Suppose the .pdf
During a recession median income falls by 20 Suppose the .pdfDuring a recession median income falls by 20 Suppose the .pdf
During a recession median income falls by 20 Suppose the .pdfaceindustriesjal
 
6 Let XPoisson and YPoisson and assume that X and Y are.pdf
6 Let XPoisson and YPoisson and assume that X and Y are.pdf6 Let XPoisson and YPoisson and assume that X and Y are.pdf
6 Let XPoisson and YPoisson and assume that X and Y are.pdfaceindustriesjal
 
Part II Fitness 8 Using the above table showing the averag.pdf
Part II Fitness 8 Using the above table showing the averag.pdfPart II Fitness 8 Using the above table showing the averag.pdf
Part II Fitness 8 Using the above table showing the averag.pdfaceindustriesjal
 
please answer AD no explanation needed will thumbs up .pdf
please answer AD no explanation needed will thumbs up .pdfplease answer AD no explanation needed will thumbs up .pdf
please answer AD no explanation needed will thumbs up .pdfaceindustriesjal
 

More from aceindustriesjal (20)

Assignment Case Study D GovEDex Disclaimer The situation .pdf
Assignment Case Study D  GovEDex Disclaimer The situation .pdfAssignment Case Study D  GovEDex Disclaimer The situation .pdf
Assignment Case Study D GovEDex Disclaimer The situation .pdf
 
El Sr Reber pens que la Sra Bissett era la empleada ideal.pdf
El Sr Reber pens que la Sra Bissett era la empleada ideal.pdfEl Sr Reber pens que la Sra Bissett era la empleada ideal.pdf
El Sr Reber pens que la Sra Bissett era la empleada ideal.pdf
 
B find the marginal Pmf of X and Y C find the covarianc.pdf
B find the marginal Pmf of X and Y  C find the covarianc.pdfB find the marginal Pmf of X and Y  C find the covarianc.pdf
B find the marginal Pmf of X and Y C find the covarianc.pdf
 
Billie Jackson was the leader of a nonprofit economic devel.pdf
Billie Jackson was the leader of a nonprofit economic devel.pdfBillie Jackson was the leader of a nonprofit economic devel.pdf
Billie Jackson was the leader of a nonprofit economic devel.pdf
 
a Construct a 95 confidence interval estimate for the popu.pdf
a Construct a 95 confidence interval estimate for the popu.pdfa Construct a 95 confidence interval estimate for the popu.pdf
a Construct a 95 confidence interval estimate for the popu.pdf
 
Dalez Corporation prepared the following two statements of e.pdf
Dalez Corporation prepared the following two statements of e.pdfDalez Corporation prepared the following two statements of e.pdf
Dalez Corporation prepared the following two statements of e.pdf
 
create a report 57 sentences executive summary and introd.pdf
create a report 57 sentences  executive summary and introd.pdfcreate a report 57 sentences  executive summary and introd.pdf
create a report 57 sentences executive summary and introd.pdf
 
a Which of the following statements is true Project teams.pdf
a Which of the following statements is true  Project teams.pdfa Which of the following statements is true  Project teams.pdf
a Which of the following statements is true Project teams.pdf
 
Sutural bone Also called Wormian bone Line Found in the me.pdf
Sutural bone  Also called Wormian bone Line  Found in the me.pdfSutural bone  Also called Wormian bone Line  Found in the me.pdf
Sutural bone Also called Wormian bone Line Found in the me.pdf
 
Church amp Dwight a large producer of sodium bicarbonate.pdf
Church amp Dwight a large producer of sodium bicarbonate.pdfChurch amp Dwight a large producer of sodium bicarbonate.pdf
Church amp Dwight a large producer of sodium bicarbonate.pdf
 
Think as if you are working in the Scottish Government or fo.pdf
Think as if you are working in the Scottish Government or fo.pdfThink as if you are working in the Scottish Government or fo.pdf
Think as if you are working in the Scottish Government or fo.pdf
 
The information that follows pertains to Esther Food Product.pdf
The information that follows pertains to Esther Food Product.pdfThe information that follows pertains to Esther Food Product.pdf
The information that follows pertains to Esther Food Product.pdf
 
Suppose the nation of Isoland is an importer of textiles and.pdf
Suppose the nation of Isoland is an importer of textiles and.pdfSuppose the nation of Isoland is an importer of textiles and.pdf
Suppose the nation of Isoland is an importer of textiles and.pdf
 
Respuesta poca del ao Duracin del da en horas .pdf
Respuesta   poca del ao   Duracin del da  en horas   .pdfRespuesta   poca del ao   Duracin del da  en horas   .pdf
Respuesta poca del ao Duracin del da en horas .pdf
 
Find the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdfFind the indicated IQ score The graph to the right depicts .pdf
Find the indicated IQ score The graph to the right depicts .pdf
 
2 Short answer What is the relationship between the nomina.pdf
2 Short answer What is the relationship between the nomina.pdf2 Short answer What is the relationship between the nomina.pdf
2 Short answer What is the relationship between the nomina.pdf
 
During a recession median income falls by 20 Suppose the .pdf
During a recession median income falls by 20 Suppose the .pdfDuring a recession median income falls by 20 Suppose the .pdf
During a recession median income falls by 20 Suppose the .pdf
 
6 Let XPoisson and YPoisson and assume that X and Y are.pdf
6 Let XPoisson and YPoisson and assume that X and Y are.pdf6 Let XPoisson and YPoisson and assume that X and Y are.pdf
6 Let XPoisson and YPoisson and assume that X and Y are.pdf
 
Part II Fitness 8 Using the above table showing the averag.pdf
Part II Fitness 8 Using the above table showing the averag.pdfPart II Fitness 8 Using the above table showing the averag.pdf
Part II Fitness 8 Using the above table showing the averag.pdf
 
please answer AD no explanation needed will thumbs up .pdf
please answer AD no explanation needed will thumbs up .pdfplease answer AD no explanation needed will thumbs up .pdf
please answer AD no explanation needed will thumbs up .pdf
 

Recently uploaded

Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...Nguyen Thanh Tu Collection
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 

NB Explain Every Line Of Code public class MainActivity.pdf

  • 1. NB. Explain Every Line Of Code public class MainActivity extends AppCompatActivity { Button b1, b2; ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); b1 = (Button) findViewById(R.id.button); b2 = (Button) findViewById(R.id.button2); b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { progressDialog = new ProgressDialog(MainActivity.this); progressDialog.setMessage("Loading..."); // Setting Message progressDialog.setTitle("ProgressDialog"); // Setting Title progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); // Progress Dialog Style Spinner progressDialog.show(); // Display Progress Dialog progressDialog.setCancelable(false); new Thread(new Runnable() { public void run() { try { Thread.sleep(10000); } catch (Exception e) { e.printStackTrace(); } progressDialog.dismiss(); } }).start(); } }); b2.setOnClickListener(new View.OnClickListener() { Handler handle = new Handler() { public void handleMessage(Message msg) { super.handleMessage(msg); progressDialog.incrementProgressBy(2); // Incremented By Value 2 } }; @Override public void onClick(View v) { progressDialog = new ProgressDialog(MainActivity.this); progressDialog.setMax(100); // Progress Dialog Max Value progressDialog.setMessage("Loading..."); // Setting Message progressDialog.setTitle("ProgressDialog"); // Setting Title
  • 2. progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); // Progress Dialog Style Horizontal progressDialog.show(); // Display Progress Dialog progressDialog.setCancelable(false); new Thread(new Runnable() { @Override public void run() { try { while (progressDialog.getProgress() <= progressDialog.getMax()) { Thread.sleep(200); handle.sendMessage(handle.obtainMessage()); if (progressDialog.getProgress() == progressDialog.getMax()) { progressDialog.dismiss(); } } } catch (Exception e) { e.printStackTrace(); } } }).start(); } }); } }