Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development

Application Development Dev Lounge for the Coder Folks



Reply
 
LinkBack Thread Tools
Old September 16th, 2010, 08:06 PM   #1 (permalink)
New Member
 
Join Date: Jul 2010
Location: Louisiana
Posts: 10
 
Device(s): HTC EVO
Thanks: 1
Thanked 0 Times in 0 Posts
Question Abstract Class issue in androidmanifest.xml

I'm working on an app that will browse to a web page. I am using an abstract class to get this done but I can't resolve an error I'm getting in the manifest.xml file.

This project is named myblogapp and it uses 2 java files in the src folder. Here is the myblogapp.java file:

package com.blueharvest.myblogapp;

import java.util.SortedMap;
import java.util.TreeMap;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public abstract class myblogapp extends ListActivity {
private SortedMap<String, Object> actions = new TreeMap<String, Object>();
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
String key = (String) l.getItemAtPosition(position);
startActivity((Intent) actions.get(key));
}

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
prepareMenu();
String[] keys = actions.keySet().toArray(
new String[actions.keySet().size()]);
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, keys));
}

public void addMenuItem(String label, Class<?> cls){
actions.put(label, new Intent(this, cls ));
}

abstract void prepareMenu();
}

*************************here is the webview.java file:*******

package com.blueharvest.myblogapp;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
import android.widget.TextSwitcher;
import android.widget.TextView;
import android.widget.ViewSwitcher;
import android.widget.Gallery.LayoutParams;
public class WebViewDemo extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.web);

final TextSwitcher pageTitle = (TextSwitcher)findViewById(R.id.pagetitle);
pageTitle.setFactory(new ViewSwitcher.ViewFactory() {
public View makeView() {
TextView tv = new TextView(WebViewDemo.this);
tv.setLayoutParams(new TextSwitcher.LayoutParams(LayoutParams.WRAP_CONTEN T, LayoutParams.WRAP_CONTENT));

return tv;
}

});

final ImageSwitcher favImage = (ImageSwitcher)findViewById(R.id.favicon);
favImage.setFactory(new ViewSwitcher.ViewFactory() {
public View makeView() {
ImageView iv = new ImageView(WebViewDemo.this);
iv.setBackgroundColor(0xFF000000);
iv.setScaleType(ImageView.ScaleType.FIT_CENTER);
iv.setLayoutParams(new ImageSwitcher.LayoutParams(LayoutParams.FILL_PAREN T, LayoutParams.FILL_PARENT));
return iv;
}

});
Animation in = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left);
Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right);
favImage.setInAnimation(in);
favImage.setOutAnimation(out);
pageTitle.setInAnimation(in);
pageTitle.setOutAnimation(out);



final EditText et = (EditText) findViewById(R.id.url);
final WebView wv = (WebView) findViewById(R.id.web_holder);
wv.loadUrl("Google");
Button go = (Button) findViewById(R.id.go_button);
go.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
wv.loadUrl(et.getText().toString());
}
});
WebViewClient webClient = new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);

String title = wv.getTitle();
pageTitle.setText(title);

}

};



//
WebChromeClient webChrome = new WebChromeClient() {

@Override
public void onReceivedIcon(WebView view, Bitmap icon) {
super.onReceivedIcon(view, icon);
favImage.setImageDrawable(new BitmapDrawable(icon));
}
};

wv.setWebViewClient(webClient);
wv.setWebChromeClient(webChrome);
wv.setInitialScale(30);
}
}


*****************Finally, this is the manifest file I have**********
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blueharvest.myblogapp"
android:versionCode="1"
android:versionName="1.0">
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:debuggable="true">
<activity
android:name=".myblogapp"
android:label="@string/app_name">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="WebView" />
</application>
<uses-permission
android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_ST ATE" />
<uses-sdk android:minSdkVersion="3" />
</manifest>


I'm getting an error on the Manifest file by the "android:label" text that reads "com.blueharvest.myblogapp.myblogapp is an abstract"

Any thoughts?

paul72 is offline  
Reply With Quote
Sponsors
Old September 18th, 2010, 12:51 PM   #2 (permalink)
New Member
 
Join Date: Jul 2010
Location: Louisiana
Posts: 10
 
Device(s): HTC EVO
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Please disregard, I found a different solution.
paul72 is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Abstract Lines Wallpaper stormalexis Android Themes 4 November 4th, 2010 02:38 PM
Need cdc abstract control model acm driver. ironhorse Fascinate - Support and Troubleshooting 2 October 6th, 2010 07:07 PM
new abstract wallpaper quic Android Themes 0 March 15th, 2010 03:57 PM
Modifying compiled AndroidManifest.xml businka Application Development 0 March 9th, 2010 04:58 PM
Viewing AndroidManifest.xml in an existing APK DaveInNYC Application Development 6 November 7th, 2009 09:25 PM



All times are GMT -5. The time now is 11:33 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo