I Inman Well-Known Member Licensed User Longtime User Sep 17, 2011 #1 I am trying to add a ProgressBar to my activity. I merely tried to initialise the ProgessBar using pbar.Initialize("pbar") and I get the error: java.lang.RuntimeException: <internal>: You must supply a layout_height attribute. The activity has some lables and imageviews before this line of code and everything works fine except for the ProgressBar. I didn't even add it to the activity using Activity.addview. I just initialised the ProgressBar before adding and got the following error. Any idea why? NB:- I have enabled Do Not Overwrite Manifest File, due to some custom permissions I added. I assume ProgressBar is like any other view and doesn't need any special entries in the Manifest file.
I am trying to add a ProgressBar to my activity. I merely tried to initialise the ProgessBar using pbar.Initialize("pbar") and I get the error: java.lang.RuntimeException: <internal>: You must supply a layout_height attribute. The activity has some lables and imageviews before this line of code and everything works fine except for the ProgressBar. I didn't even add it to the activity using Activity.addview. I just initialised the ProgressBar before adding and got the following error. Any idea why? NB:- I have enabled Do Not Overwrite Manifest File, due to some custom permissions I added. I assume ProgressBar is like any other view and doesn't need any special entries in the Manifest file.
klaus Expert Licensed User Longtime User Sep 17, 2011 #2 I didn't even add it to the activity using Activity.addview. Click to expand... But you need to ! That's the problem. Best regards. Upvote 0
I didn't even add it to the activity using Activity.addview. Click to expand... But you need to ! That's the problem. Best regards.
I Inman Well-Known Member Licensed User Longtime User Sep 17, 2011 #3 klaus said: But you need to ! That's the problem. Click to expand... Nope. I just added it to the ScrollView which has the above mentioned labels and imageviews and I get the same error at the same line. Upvote 0
klaus said: But you need to ! That's the problem. Click to expand... Nope. I just added it to the ScrollView which has the above mentioned labels and imageviews and I get the same error at the same line.
klaus Expert Licensed User Longtime User Sep 17, 2011 #4 Without any code it's impossible to give you an answer. The best way to get a concrete and efficient help is to post your project as a zip file (IDE menu 'File/Exports As Zip'). That way we know what you have done and how. Otherwise we need to guess what you could have done, what you should have done and what you probably have done wrong and additionnaly create a project trying to reproduce the problem you have. Time consuming, boring and unefficient. Best regards. Upvote 0
Without any code it's impossible to give you an answer. The best way to get a concrete and efficient help is to post your project as a zip file (IDE menu 'File/Exports As Zip'). That way we know what you have done and how. Otherwise we need to guess what you could have done, what you should have done and what you probably have done wrong and additionnaly create a project trying to reproduce the problem you have. Time consuming, boring and unefficient. Best regards.
I Inman Well-Known Member Licensed User Longtime User Sep 17, 2011 #5 klaus said: Without any code it's impossible to give you an answer. The best way to get a concrete and efficient help is to post your project as a zip file (IDE menu 'File/Exports As Zip'). That way we know what you have done and how. Otherwise we need to guess what you could have done, what you should have done and what you probably have done wrong and additionnaly create a project trying to reproduce the problem you have. Time consuming, boring and unefficient. Click to expand... Due to the nature of the project, I cannot post the complete source code. So for the convenience of the community, I created a new project which contains just the following lines: Code: Copy Sub Globals Dim pb As ProgressBar End Sub Sub Activity_Create(FirstTime As Boolean) pb.Initialize("pb") activity.AddView(pb,20dip,20dip,20dip,20dip) End Sub And I still get the error. The project has been attached. Attachments progressbar test.zip progressbar test.zip 4.8 KB · Views: 398 Upvote 0
klaus said: Without any code it's impossible to give you an answer. The best way to get a concrete and efficient help is to post your project as a zip file (IDE menu 'File/Exports As Zip'). That way we know what you have done and how. Otherwise we need to guess what you could have done, what you should have done and what you probably have done wrong and additionnaly create a project trying to reproduce the problem you have. Time consuming, boring and unefficient. Click to expand... Due to the nature of the project, I cannot post the complete source code. So for the convenience of the community, I created a new project which contains just the following lines: Code: Copy Sub Globals Dim pb As ProgressBar End Sub Sub Activity_Create(FirstTime As Boolean) pb.Initialize("pb") activity.AddView(pb,20dip,20dip,20dip,20dip) End Sub And I still get the error. The project has been attached.
klaus Expert Licensed User Longtime User Sep 17, 2011 #6 The code you posted works with the Emulator. Do you really want such a small ProgressBar width 20dip height 20 dip Try to increase these values to see if it solves the problem (especially the height value according to the error message). Best regards. Upvote 0
The code you posted works with the Emulator. Do you really want such a small ProgressBar width 20dip height 20 dip Try to increase these values to see if it solves the problem (especially the height value according to the error message). Best regards.
I Inman Well-Known Member Licensed User Longtime User Sep 17, 2011 #7 Changing the layout values didn't fix it. But it looks like the issue is for my device only. I have a Nexus One running MIUI 1.6.3 (Android 2.3.4) and I get the above error. Then I mailed the apk to a friend, who tested on his Samsung Galaxy S2 running 2.3.4 and it worked fine there. Must be some issue with the MIUI rom. Let me see if I can find someone running a recent build of MIUI and see if he gets this error. Sorry for the trouble guys. This error might be device and rom specific. Upvote 0
Changing the layout values didn't fix it. But it looks like the issue is for my device only. I have a Nexus One running MIUI 1.6.3 (Android 2.3.4) and I get the above error. Then I mailed the apk to a friend, who tested on his Samsung Galaxy S2 running 2.3.4 and it worked fine there. Must be some issue with the MIUI rom. Let me see if I can find someone running a recent build of MIUI and see if he gets this error. Sorry for the trouble guys. This error might be device and rom specific.