Instantiating custom views. There is a no class attribute etc. if you’re trying to find one in the XML, instead the fully-qualified class name is used as the tag. <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <com.adamish.android.dmxapp.DmxView2d android:layout_width=”match_parent” android:layout_height=”fill_parent” android:id=”@+id/laser_pos_panel” /> </LinearLayout>
Tag: android
Android dev: handling touch events on custom views
Embarrassingly this tripped me up for a while. In a custom view there were only single “click” events being called when a finger was dragged across the screen. This was due to the return value from the method being false (default in eclipse when you choice source: override methods. Changing it to true means that… Continue reading Android dev: handling touch events on custom views
Android dev: app navigation using back button
The back button can be used to navigate within an application. The easiest way to do this is to define multiple activities. Activities can be moved into using action buttons etc, and then can be exited using the back button. This should work to any number of levels. Activities are defined in AndroidManifest.xml. Below is… Continue reading Android dev: app navigation using back button