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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:45:32+00:00 2026-06-15T23:45:32+00:00

I am building a simple chat app where the user has the ability to

  • 0

I am building a simple chat app where the user has the ability to send text and emoticons. I can send both text and emoticons to another phone. My problems are:

1.When I type something and add an emoticon:

enter image description here

Then I cannot type any text right before and right after the image. I can write before the “o” letter. The system “sees” that I type, so even if I type “Honey” after the smiley, I cannot see it, but the EditText registers it and the message is sent:

enter image description here

2.When I add just an emoticon to the Edittext then I delete it, I cannot type anything because the deleted emoticon appears. It appears only once, so no matter how many characters I type, the EditText looks like just before I deleted the emoticon, BUT the text is sent without the emoticon, just like in all three cases.

3.When I type “something” in the EditText then insert an emoticon after “some”:

enter image description here

Then I put the cursor after the emoticon and delete it, here what’s left:

enter image description here

But the correct message is sent when I press the Send button:

enter image description here

That’s what’s inside the button listener of the emoticon (this method is activated when I click the emoticon to add it to the EditText).

ib_happy.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {

        int cursorPosition = mOutEditText.getSelectionStart();
            mOutEditText.getText().insert(cursorPosition, smileys[0]);
        SpannableStringBuilder ssb = new SpannableStringBuilder(mOutEditText.getText());
        ssb.setSpan(new ImageSpan(bitmapArray.get(0), ImageSpan.ALIGN_BASELINE), cursorPosition,  cursorPosition+2, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        mOutEditText.setText(ssb, BufferType.SPANNABLE);
            mOutEditText.setSelection(cursorPosition+2);
        dialog_emoticon.dismiss();
    }
});
  • 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-15T23:45:33+00:00Added an answer on June 15, 2026 at 11:45 pm

    I found the solution. All I had to do was to change Spannable.SPAN_INCLUSIVE_INCLUSIVE to Spannable.SPAN_EXCLUSIVE_EXCLUSIVE

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

Sidebar

Related Questions

I'm building a simple chat app with Rails. when a user types in a
I'm building a simple client-server chat system. The clients send data to the server
I'm building a simple multi-user (multi-tenant?) App with ASP.NET MVC3 and EF4, one database,
I'm building a simple chat server in java , where users can have private
I am building a simple mechanism where a user can like a post by
I'm building a simple accounting app to be used for personal finance. A user
Im building a simple chat client which is only supposed to be able to
I'm building a simple live chat into a web application running on Django, but
Well, lets say I'm building ActiveMQ based chat application. It's pretty simple. Having only
If you are building a simple website using just simple HTML/CSS/Javascript that has say

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.