Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:38:42+00:00 2026-06-03T21:38:42+00:00

This is a very naive issue. I want to call two different class from

  • 0

This is a very naive issue.
I want to call two different class from two different buttons.
The below code is working fine but the GalleryView.class is getting executed only for once.The moment i call the SelectImage.class which is a dialogue seems to be working fine but the other one showing up only once.Please throw some light on this.

Thanks & Regards
Avijit Paul

private Button button,button1;
public static String filename = "prefs";
SharedPreferences prefs;

public vp_default() 
{
    // TODO Auto-generated constructor stub
}

 public void onCreate(Bundle savedInstanceState) 
    {       
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);   
        prefs = getSharedPreferences(filename,0);

        button  = (Button)findViewById(R.id.view_gallery_button);
        button.setOnClickListener(this);

        button1  = (Button)findViewById(R.id.sel_image_button);
        button1.setOnClickListener(this); 

    }

    @Override
    public void onClick(View v) 
    {
            String setPhnNo = "9231512345";
            boolean stat = prefs.contains(setPhnNo);

            switch(v.getId())
            {
             case R.id.view_gallery_button:     
                    if(stat!=false)
                    {

                        startActivity(new Intent(getApplicationContext(), VirtualPainterActivity.class));

                    }
                    else
                    {
                        startActivity(new Intent(getApplicationContext(), GalleryView.class));


                    }
                break;
                case R.id.sel_image_button: 
                        startActivity(new Intent(getApplicationContext(), SelectImage.class));

                break;
            }

    }

}

//manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="mcc.vp.apps"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="15" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
         <activity
            android:label="@string/app_name"
            android:name=".vp_default" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity> 
        <activity
            android:label="@string/app_name"
            android:name=".VirtualPainterActivity"
            android:theme="@android:style/Theme.Dialog">
            <intent-filter >
                <action android:name="android.intent.action.vp_regn" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".GalleryView">
            <intent-filter >
                <action android:name="android.intent.action.vp_gview" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".SelectImage" >
            <intent-filter >
                <action android:name="android.intent.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".ViewImage">
            <intent-filter >
                <action android:name="android.intent.vp_view_img" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:38:44+00:00Added an answer on June 3, 2026 at 9:38 pm

    Finnally solved it…The Problem was in the manifest file..i have declared “action.MAIN” twice..and the button keeps on iterating the default activity…anywz thanks to everyone for their time…. @Perroloco @Akki @Zaz Gmy

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This very simple code: #include <iostream> using namespace std; void exec(char* option) { cout
In this very simple code example, messages get lost every once in a while.
I have this very simple sql statement: SELECT max_dose FROM psychotropes WHERE (patient_meds.psychotrope =
I have built a very naive parallel ssl acceptor. -module(multiserver). -export([start/0,client/1]). %% This is
This very strange. When I resize a WinForms dialog the controls are flickering very
Given this very familiar model of prototypal construction: function Rectangle(w,h) { this.width = w;
Important : Please see this very much related question: Return multiple values in C++
I have this very simple example that I am using to learn structs in
I was making this very simple lex program (just an introductory program). But on
I posted this very same item on SERVERFAULT, but got no reply. So here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.