Tracker customerPageTracker;
ProgressDialog progress;
String myName;
int myTotal;
int myAvaliable;
String myRank;
String customerNumber;
Bitmap barcode = null;
String customrURl;
ImageView imageview;
TextView num ,pointText, pointsEarned,rank,customerName,myPurchases;
Button logout, account, more;
//Variables to send to the server for customers
String customer_id;
String android_id;
String notification_id;
String operating_system_type;
Tracker mTracker;
AnalyticsApplication app;
Activity myActivity;
Context customerPageContext;
CustomerInfoJsonParser cijp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mypage_layout);
//build statusbar
CustomStatusbar customStatusbar = new CustomStatusbar();
customStatusbar.makeSatusBar(this);
progress = ProgressDialog.show(this, "Loading", "PleaseWait", true);
cijp = new CustomerInfoJsonParser();
customrURl = getString(R.string.customerCRM);
customerPageContext = this;
//generate the UI
getUIAssignments();
// [START shared_tracker]
// Obtain the shared Tracker instance.
app = (AnalyticsApplication) getApplication();
mTracker = app.getDefaultTracker();
// [END shared_tracker]
mTracker.setScreenName("CustomerPage Screen");
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
customerPageTracker = ((AnalyticsApplication) getApplication()).getDefaultTracker();
myActivity = this;
asignValues(cijp, myPurchases);
new Thread(new Runnable() {
@Override
public void run()
{
// do the thing that takes a long time
//fill in the customers information
buildBarcode(imageview, num);
runOnUiThread(new Runnable() {
@Override
public void run()
{
createUI(pointText, pointsEarned, rank, customerName);
getSendingData();
progress.dismiss();
}
});
}
}).start();
//Build the rules for the buttons
myButtons(customerPageTracker);
ButtonControler bc = new ButtonControler();
bc.buttonPressed(this);
}