---
title: "Using Intent in an Android application to show another activity"
author: "netfork"
date: "2011-03-07T21:53:05Z"
tags: []
categories: ["移动开发"]
slug: "using-intent-in-an-android-application-to-show-another-activity"
draft: false
lastmod: "2011-03-07T21:53:05Z"
id: 945663
url: "https://netfork.iteye.com/blog/945663"
---

n my Android application, I have two activity classes. I have a button on the first one and I want to show the second when it is clicked, but I get an error. Here are the classes:

This was a run time error. The emulator gave the generic "the application has stopped unexpectedly" error, but using the debugger, it showed a "android.content.ActivityNotFoundException: Unable to find explicit activity class {class name} have you declared this activity in your AndroidManifest.xml? – [Tai Squared](http://stackoverflow.com/users/4555/tai-squared "1706 reputation")

 

The issue was the OrderScreen activity wasn't added to the [AndroidManifest.xml](http://developer.android.com/guide/topics/manifest/manifest-intro.html). Once I added that as an application node, it worked properly.

[http://stackoverflow.com/questions/736571/using-intent-in-an-android-application-to-show-another-activity](http://stackoverflow.com/questions/736571/using-intent-in-an-android-application-to-show-another-activity)