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

  • Home
  • SEARCH
  • 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 7040055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:52:21+00:00 2026-05-28T01:52:21+00:00

I have dialog with 2 horizontal galleries and one LinearLayout , and i have

  • 0

I have dialog with 2 horizontal galleries and one LinearLayout, and i have problem with focus.

It looks like this:


Gallery 1

Gallery 2

LinearLayout

Gallery 2 is some kind of submenu of Gallery 1.

I’ve implemented onItemSelected listener for both galleries. When i select something in Gallery1 content of Gallery 2 is changed and focus stays on Gallery 1. And it work fine.

When i select something in Gallery 2 i have to inflate xml file in LinearLayout and do something with that.

Problem is when i select something in Gallery 2, and inflate xml in LinearLayout…focus goes on Gallery 1, but I need it to stay on Gallery 2, until I press Up or Down or whatever. Don’t know what is the problem, it makes no sense to me.

Do you have some idea?

Gallery2.requstFocus() doesn’t help.

  • 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-05-28T01:52:21+00:00Added an answer on May 28, 2026 at 1:52 am

    I’ve forgot about this problem, ‘couse i’ve gave up 🙂
    But recently i had a similar problem and solve it…

    The fact is that requestFocus command doesnt have time to done its work if your GUI is complex.

    Its a Android bug…

    I’ve solve similar problem with some kind of finite state machine and threads to update focus.

    I have one variable which represent states, for focus…which item has to focused.
    I have made one thread for each state.
    In thread I do something like this:

    item1.clearFocus();
    item2.clearFocus();
    item3.requestFocus();

    Hope you understand what I want to say.

    In my app when i need to focus particular item, i just start the “updating focus thread” for that item.

    Thats all, hope u solve yours problem.

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

Sidebar

Related Questions

I have dialog created like this $('#add_error').click(function(e) { $('<div>') .load('/someaction/format/html/') .dialog({ title: 'Some title',
I have this nice dialog view I set my UserInputDialog class to: <LinearLayout android:id=@+id/LinearLayout01
I have a LinearLayout with some nested LinearLayouts, ImageView's and TextViews. One of the
In my android app i show a custom dialog. In this dialog i have
So I have a webview I'd like to display as a dialog. I'd like
I'm new to android and have been stuck on this problem for a long
here I have a custom dialog with background 2 ImageButton inside it. the problem
fI have created two layout files. First one is main.xml <?xml version=1.0 encoding=utf-8?> <LinearLayout
I've been working on this application but have come across a problem that I
In my application I have a custom dialog which display some unwanted margin at

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.