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 7716039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:32:14+00:00 2026-06-01T02:32:14+00:00

Here’s the code I’m using to make a custom AlertDialog. public void onButtonClicked(View v)

  • 0

Here’s the code I’m using to make a custom AlertDialog.

public void onButtonClicked(View v) {
    LayoutInflater onButtonClick = LayoutInflater.from(this);
    PropManager propmanager = new PropManager();
    final View onButtonClickView = onButtonClick.inflate(
            R.layout.buttondialog, null);
    TextView mbname = (TextView) findViewById(R.id.mbname);
    TextView mbdisplayid = (TextView) findViewById(R.id.mbdisplayid);
    TextView mbdevice = (TextView) findViewById(R.id.mbdevice);
    TextView mbkernel = (TextView) findViewById(R.id.mbkernel);
    TextView mbvspath = (TextView) findViewById(R.id.mbvspath);

    String mbvspathv = propmanager.multiBootVSPathProp();
    String mbkernelv = propmanager.kernelProp();
    String mbdevidev = propmanager.deviceProp();
    String mdisplayidv = propmanager.displayIdProp();
    String mbnanev = propmanager.vSNameProp();
    mbname.setText(mbnanev);
    mbdisplayid.setText(mdisplayidv);
    mbdevice.setText(mbdevidev);
    mbkernel.setText(mbkernelv);
    mbvspath.setText(mbvspathv);
    new AlertDialog.Builder(this).setView(onButtonClickView).show();

}

public String vSNameProp() {
    String mbvsprop = "none";
    try {
        Scanner scanner = new Scanner(propReader()).useDelimiter("\\n");
        scanner.findWithinHorizon(
                Pattern.compile("\\[ro.multiboot.vs\\].*\\[(.+?)\\]"), 0);
        mbvsprop = scanner.match().group(1);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    File vs = new File(mbvsprop);
    return "Active VFS\t: " + vs.getName();
}

But it force closes on clicking Button.

03-30 17:01:59.717: W/System.err(9802): java.lang.IllegalStateException
03-30 17:01:59.727: W/System.err(9802):     at java.util.Scanner.match(Scanner.java:963)
03-30 17:01:59.727: W/System.err(9802):     at com.manager.boot.free.PropManager.vSNameProp(PropManager.java:138)
03-30 17:01:59.737: W/System.err(9802):     at com.manager.boot.free.OSListActivity.onButtonClicked(OSListActivity.java:1177)
03-30 17:01:59.737: W/System.err(9802):     at java.lang.reflect.Method.invokeNative(Native Method)
03-30 17:01:59.737: W/System.err(9802):     at java.lang.reflect.Method.invoke(Method.java:511)
03-30 17:01:59.737: W/System.err(9802):     at android.view.View$1.onClick(View.java:3039)
03-30 17:01:59.737: W/System.err(9802):     at android.view.View.performClick(View.java:3511)
03-30 17:01:59.737: W/System.err(9802):     at android.view.View$PerformClick.run(View.java:14105)
03-30 17:01:59.737: W/System.err(9802):     at android.os.Handler.handleCallback(Handler.java:605)
03-30 17:01:59.737: W/System.err(9802):     at android.os.Handler.dispatchMessage(Handler.java:92)
03-30 17:01:59.747: W/System.err(9802):     at android.os.Looper.loop(Looper.java:137)
03-30 17:01:59.757: W/System.err(9802):     at android.app.ActivityThread.main(ActivityThread.java:4424)
03-30 17:01:59.757: W/System.err(9802):     at java.lang.reflect.Method.invokeNative(Native Method)
03-30 17:01:59.767: W/System.err(9802):     at java.lang.reflect.Method.invoke(Method.java:511)
03-30 17:01:59.767: W/System.err(9802):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-30 17:01:59.767: W/System.err(9802):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-30 17:01:59.767: W/System.err(9802):     at dalvik.system.NativeStart.main(Native Method)
03-30 17:01:59.767: D/AndroidRuntime(9802): Shutting down VM
03-30 17:01:59.767: W/dalvikvm(9802): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
03-30 17:01:59.787: E/AndroidRuntime(9802): FATAL EXCEPTION: main
03-30 17:01:59.787: E/AndroidRuntime(9802): java.lang.IllegalStateException: Could not execute method of the activity
03-30 17:01:59.787: E/AndroidRuntime(9802):     at android.view.View$1.onClick(View.java:3044)
03-30 17:01:59.787: E/AndroidRuntime(9802):     at android.view.View.performClick(View.java:3511)
03-30 17:01:59.787: E/AndroidRuntime(9802):     at android.view.View$PerformClick.run(View.java:14105

)

Why?

  • 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-01T02:32:15+00:00Added an answer on June 1, 2026 at 2:32 am

    I can’t exactly tell what is going wrong with your code.(It is harder because your variable names are not very descriptive. i.e. there is no obvious reason why reference that is named “onButtonClick” would be a reference to a LayoutInflater object. It makes it more confusing to understand what is going on.) But here is a snippet that you can start from that will create a custom AlertDialog:

        LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View layout = inflater.inflate(R.layout.yourLayoutId, (ViewGroup) findViewById(R.id.yourLayoutRoot));
        AlertDialog.Builder builder = new AlertDialog.Builder(this)
        .setView(layout);
        AlertDialog alertDialog = builder.create();
        alertDialog.show();
    

    Also, I think (but am not positive) that you would need to change your findViewById() calls to be called on you view instance, not your activity as you are now. so change:

    TextView mbname = (TextView) findViewById(R.id.mbname);
    etc...
    

    to

    TextView mbname = (TextView) onButtonClickView.findViewById(R.id.mbname);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my test function (c#, visual studio 2010): [TestMethod()] public void TestGetRelevantWeeks() { List<sbyte>
Here my code: $(document).ready(function() { $('#mid_select').live('click', function(e){ $('#middle').load( $(this).attr('href') + ' #middle'); var page
Here is my code, which takes two version identifiers in the form 1, 5,
Here's a coding problem for those that like this kind of thing. Let's see
Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here is an example: I write html code inside of textarea, then I swap
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is my query: SELECT * FROM [GeoName] WHERE ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) < 0.005 ORDER BY

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.