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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:50:29+00:00 2026-05-26T08:50:29+00:00

View hierarchy is as follows TabActivity -> ActivityGroups -> Activities . Using MAT I

  • 0

View hierarchy is as follows TabActivity -> ActivityGroups -> Activities.

Using MAT I found that TabWidget is referenced by TabHost which is referenced by InputMethodManager, hence TabWidget is leaked. On Subsequent launch of application OutOfMemory Error is thrown.

Similarly all my activities are also referenced by InputMethodManager.
(After closing the application all my activitygroups, activities, tabactivity, tabhost and tabwidget are leaked!!)

On Properly finishing the application (hitting back key), following is shown in logcat

WARN/InputManagerService(99): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@44a87748 (uid=10052 pid=1463)

How to remove the reference from InputMethodManager…?

Thing I tried:

A. Called this method onDestroy of my TabActivity
1. myTabWidget.removeAllViews()
2. myTabWidger.invalidate()

No Luck!


  • Already posted question:
    Main Activity is not garbage collected after destruction because it is referenced by InputMethodManager indirectly
  • 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-26T08:50:30+00:00Added an answer on May 26, 2026 at 8:50 am

    Thing I tried: A. Called this method onDestroy of my TabActivity 1.myTabWidget.removeAllViews() 2.myTabWidger.invalidate()

    Of course, it will not work. Activities aren’t views neither in MVC/MVP/MVVM nor in Android SDK classes hierarchy. android.app.Activity doesn’t extend android.view.View

    My colleague had similar problem with memory leaks – he declared tabHost in TabActivity in static way (he wanted to access it from another activity, when he hadn’t been familiar with pattern Observer). I think you’ve made something similar.

    And, at last, my question: why do you reference activities in InputMethodManager (though I don’t understand how: it’s final class) and not InputMethodManager in activities? If you want global focus point for InputMethodManager, I can advice you to put reference of it to Application class. We extend Application class (for example, HostApplication), in this facade we declare common stuff (SharedPreferences, for example). And in the activities we write:

    HostApplication application = (HostApplication) getApplication();
    

    Then we get useful common stuff from it.

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

Sidebar

Related Questions

I have a view hierarchy that is layed out as follows: parentView scrollView contentViewA
Example: Can I make a NIB which represents an view hierarchy, and use this
I have a UITableViewController in my app, which is added to the view hierarchy
I am using a Tree View Hierarchy inside the UpdatePanel . The ASP.NET code
I have a view hierarchy that looks something like this: UIView (A) UIView >
I have created a custom view hierarchy in an XIB that I want to
Using a navigation based view hierarchy. I have a root view controller, and multiple
How to create a view hierarchy programmatically without using a nib ?
I have several WebViews that I swap in and out of my view hierarchy.
Assume that the term hierarchy is as follows Vocabulary = TOPIC Sports (PARENT TERM)

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.