Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Java Persistence with Spring Data and Hibernate
this week in the
Spring
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Tim Cooke
Paul Clapham
Liutauras Vilda
Sheriffs:
Junilu Lacar
Rob Spoor
Jeanne Boyarsky
Saloon Keepers:
Stephan van Hulst
Carey Brown
Tim Holloway
Piet Souris
Bartenders:
Forum:
Android
No Activity found to handle Intent { act=com.application.activity.MainActivity }
Sarra Sakka
Ranch Hand
Posts: 283
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I create 2 packges : one for mainactivity, another for login interface
Here's the file AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.application.activity" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.application.login.Login" 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=".activity.MAINACTIVITY" android:configChanges="orientation|keyboardHidden" android:label="@string/app_name" > <intent-filter> <action android:name="com.application.activity.MAINACTIVITY" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application> </manifest>
here's the Login class :
package com.application.login; import java.util.ArrayList; import android.app.Activity; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import com.application.activity.R; public class Login extends Activity implements View.OnClickListener{ ArrayList<Integer> tabid = new ArrayList <Integer>(); ArrayList <Double> tabpass = new ArrayList <Double>(); Button login; Button cancel; EditText id; EditText pass; int n= tabid.size(); int m= tabpass.size(); protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); DatabaseLogin db = new DatabaseLogin(this); db.open(); tabid = db.getIdentifiant();//tableau contient tout les identifiant tabpass = db.getPassword();//tableau contient tout les mot de passe initialize(); login.setOnClickListener(this); cancel.setOnClickListener(this); db.close(); } private void initialize() { // TODO Auto-generated method stub login =(Button) findViewById(R.id.blogin); cancel =(Button) findViewById(R.id.bcancel); id = (EditText) findViewById(R.id.edtid); pass = (EditText) findViewById(R.id.edtpassword); } @Override public void onClick(View v) { // TODO Auto-generated method stub switch(v.getId()) { case R.id.blogin: boolean didItWork=true; String editid = id.getText().toString(); String editpass = pass.getText().toString(); didItWork = Verif(editid,editpass);//Verif is a method to compare the entry text in the editText with the value found in the database if (didItWork) { Intent i = new Intent("com.application.activity.MainActivity"); startActivity(i); } else { Dialog d = new Dialog(this); d.setTitle("Error!"); TextView tv = new TextView(this); tv.setText("Error "); d.setContentView(tv); d.show(); } break; case R.id.bcancel: break; } } public boolean Verif(String editid,String editpass){ boolean verif = false ; double id =Double.parseDouble(editid); double pass =Double.parseDouble(editpass); for(int i=0; i<tabid.size(); i++) { if ((id == tabid.get(i)) &&(pass == tabpass.get(i))) { verif = true; break; } } return verif; } }
The Logcat display :
07-24 12:26:29.783: E/AndroidRuntime(716): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.application.activity.MainActivity }
Sarra Sakka
Ranch Hand
Posts: 283
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I resolve my problem, just change some thing in the file androidManifest.xml by this :
<activity android:name="com.application.activity.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="com.application.activity.MainActivity" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Input Data to MySQL Database
How to retrieve string from EditText?
Starting a new activity from current
Cannot find the problem in the code
Android newbie's problem
More...