marquee Example in Android
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:id="@+id/MarqueeText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:freezesText="true" android:marqueeRepeatLimit="marquee_forever" android:textSize="30dp" android:scrollHorizontally="true" android:singleLine="true" android:text="hai friends Distance is aaaaaaaaaaaa aaaaaaaaa" > </TextView> </LinearLayout>
Wednesday, 21 November 2012
marquee Example in Android
Saturday, 10 November 2012
Set an onClickListner method to MapActivity
Set an onClickListner method to MapActivity
1)
First do the setContentView, after that the Button is findable. The system could not find your Button now, so that's why it is a null. Your MapView map also would be a null in your code. 2) If you define an object within {} it is only available within that {} You probably going to need the Object "but" later, so make it a private variable of the class. 3) Classname should start with a capital. 4) Visit anddev.org or some site like that for coding problems, xda seems to be more focused on system/firmware issues, not application code. So, this should work: public class MainActivity extends MapActivity { final Button but; final MapView map; @Override public boolean isRouteDisplayed() { return false; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); but = (Button) findViewById(R.id.gpsButton); but.setOnClickListener(new View.OnClickListener() { public void onClick(View v){ } }); map = (MapView) findViewById(R.id.myMap); } } | |
remove title bar in Android
How to remove title bar in Android
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jithu.c"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name=".PlacefinderdemoActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:required="true" android:name="com.google.android.maps"></uses-library>
<activity android:name=".alm.alarm"></activity>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jithu.c"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<activity android:name=".PlacefinderdemoActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:required="true" android:name="com.google.android.maps"></uses-library>
<activity android:name=".alm.alarm"></activity>
</application>
</manifest>
Subscribe to:
Posts (Atom)