C,
pasted
on Jul 14:
|
package android.english.toeictraining;
import android.content.Context;
import android.content.Intent;
import android.english.toeictraining.adapters.ItemLevelAdapter;
import android.english.toeictraining.utils.Var;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private ItemLevelAdapter adapter;
private Context context;
private ViewGroup layoutProgress;
private ProgressBar progressBar;
private TextView tvNotify;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.context= this;
setupToolbar();
setupRecyclerView();
this.layoutProgress= (ViewGroup) findViewById(R.id.linearlayout_progress);
this.progressBar= (ProgressBar) findViewById(R.id.progress);
this.tvNotify= (TextView) findViewById(R.id.tvNotify);
}
private void setupToolbar(){
Toolbar toolbar= (Toolbar) findViewById(R.id.toolbar);
if(toolbar != null){
setSupportActionBar(toolbar);
}
}
private void setupRecyclerView(){
RecyclerView recyclerView= (RecyclerView) findViewById(R.id.recyclerview_menu_level);
// If the size of views will not change as the data changes.
recyclerView.setHasFixedSize(true);
// Setting the LayoutManager.
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
// Setting the adapter.
adapter = new ItemLevelAdapter(context, Var.ICONS, Var.LEVEL, Var.LEVEL_DESCRIPTION);
recyclerView.setAdapter(adapter);
}
public void onResume(){
super.onResume();
refresh();
}
private void refresh(){
layoutProgress.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
tvNotify.setVisibility(View.GONE);
Var.showToast(context, "refresh");
}
// bắt sự kiện click item cardview
@Override
public void onClick(View v) {
Var.showToast(context, "success");
Intent intent = new Intent(context, CategoryActivity.class);
startActivity(intent);
}
}
|
Output:
|
Line 1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 4: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 6: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 7: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 8: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'android'
Line 17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'class'
Line 29: error: stray '@' in program
Line 101: error: stray '@' in program
|
|