Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.app.Activity;

import android.view.Gravity;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.ProgressBar;

public class Main {
    public static LinearLayout setProgressBarLayout(Activity activity) {

        LinearLayout progressBarLayout = new LinearLayout(activity);
        progressBarLayout.setGravity(Gravity.CENTER);
        ProgressBar spinner = new ProgressBar(activity);
        progressBarLayout.addView(spinner);
        activity.addContentView(progressBarLayout,
                new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

        return progressBarLayout;
    }
}