progress wheel not working in code

289 views Asked by At

Hi i am using progress wheel for loading it is working when i am using in xml and calling in java. But it is not working in code side itself my code is written bellow.

this is working

 ProgressWheel s=(ProgressWheel)findViewById(R.id.progress_wheel);
s.setBarColor(Color.GREEN);
s.spin();

this code is not working

RelativeLayout.LayoutParams params = new   RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);

        ProgressWheel progressWheel = new ProgressWheel(DriverLogin.this);
        progressWheel.setBarColor(Color.GREEN);
        progressWheel.setLayoutParams(params);
        progressWheel.spin();

when i am creating ProgressWheel from code itself it is not working how to solve this

0

There are 0 answers