android-discuss, Custom HomeScreen - Please help

Custom HomeScreen - Please help

by rams » Thu, 22 Jul 2010 12:05:59 GMT

Sponsored Links

Hello All,
I am developing a Custom HomeScreen
as in the image attached:
It has 3 screens. Screen 1 and Screen 2
has an overlap. Screen 2 and Screen 3 has
an overlap widget.
I created a horizontal scrollview with
3 linearlayouts (vertical) of size 320x480dip
and put 1 button on each layout.
<HorizontalScrollView>
<LinearLayout>
</LinearLayout>
<LinearLayout>
</LinearLayout>
<LinearLayout>
</LinearLayout>
</HorizontalScrollView>
On click of the button, I try to scroll the screen but
scroll is not working. I used the following code:
scrollview.setSmoothScrollingEnabled(true);
scrollview.scrollTo(320, scrollview.getTop());
Could anyone please help me in fixing this?
Thanks,
Ram
--

Pl. Hellllppppp,
Why below code is throwing nullPointer exception in last line
(when accessing javaInterface.mValue)
This line through NullPointer, so basically it is not being set. even
though the javascript is correct and has been verified using FireBug
that it returns expected string.
..............................................................................................................
----- There are few lines above this code chunk but it is irrelevant
this problem
-----
------
DemoJavaScriptInterface javaInterface = new
DemoJavaScriptInterface();
storeView.addJavascriptInterface(javaInterface, "demo");
//String jScript4 = "";
solo.sleep(10000);
//storeView.loadUrl("javascript:var
mV=document.getElementById(\"color-link-box-top
\").getElementsByTagName(\"p\")[0].innerHTML;alert(mV);");
solo.sleep(2000);
storeView.loadUrl("javascript:window.demo.Value(document.getElementById(\"color-
link-box-top\").getElementsByTagName(\"p\")[0].innerHTML)");
System.out.println(javaInterface.mValue); //This line
through NullPointer, so basically it is not being set.
//Assert.assert()
}
final class DemoJavaScriptInterface
{
String mValue;
public void Value(String myVal)
{
mValue = myVal;
}
DemoJavaScriptInterface() {
}
}
--