CN107506178A - A kind of page jump management method and device - Google Patents
A kind of page jump management method and device Download PDFInfo
- Publication number
- CN107506178A CN107506178A CN201710507925.9A CN201710507925A CN107506178A CN 107506178 A CN107506178 A CN 107506178A CN 201710507925 A CN201710507925 A CN 201710507925A CN 107506178 A CN107506178 A CN 107506178A
- Authority
- CN
- China
- Prior art keywords
- page
- mode
- redirects
- jump
- webview
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Abstract
The application, which describes a kind of page jump management method and device, this method, to be included:When detecting that obtain that the first page jumps to the second page redirects mode when jumping to second page from first page;When detect be back to the first page from the second page when, according to get redirect mode to the first page perform corresponding to predetermined registration operation.The mode that redirects includes:Redirection redirects mode and triggering redirects mode.If the mode that redirects redirects mode for redirection, the first page is closed;If the mode that redirects redirects mode for triggering, refresh the first page.Present application addresses occurring in the mobile terminal using Android system, the problem of entering endless loop when being back to homepage from the redirection page of homepage caused by due to automatic refreshing that homepage is set.
Description
Technical field
The application is related to mobile internet technical field, more particularly to a kind of page jump management method and device.
Background technology
At present, Web page, such as many electric business platform application programs are all provided with many application programs.In Android
In android system, the loading of the page is realized by WebView component.Homepage is loaded in the WebView of initialization
URL (Uniform Resource Locator, URL), user's can carries out some behaviour in homepage
Make, hence into the subpage frame of homepage.When user is back to homepage from subpage frame, it will usually set automatically to homepage
Face carries out refresh operation.If when entering WebView, the URL of homepage is redirected to other positions, then when returning to
During homepage, homepage can enter in endless loop because of refresh operation, can not exit.
For example, when user is paid the bill by the mobile terminal of Android system, payment application can be opened and entered and paid
Money homepage.Logged in if the user has completed account, and complete system of real name certification, then show the payment homepage.With
Family so can in the subpage frame of the payment homepage such as being supplemented with money, withdrawn deposit or transferred accounts operation.When user is from subpage
When face is back to payment homepage, payment homepage can be refreshed automatically, so as to ensure that user obtains the payment homepage
Up-to-date information.But complete account in user and log in, and load the payment in the case of no completion system of real name certification
During homepage, the payment homepage can be redirected to the real-name authentication page.If now user does not carry out real-name authentication, but point
Return key has been hit, will have been entered because of the automatic refresh operation that payment homepage is set in endless loop.
The content of the invention
The main purpose of the application is to propose a kind of page jump management method and device, solved in Android system
In, enter caused by due to automatic refreshing that homepage is set when being back to homepage from the redirection page of homepage dead
The problem of circulation.
To achieve the above object, this application provides a kind of page jump management method, the movement applied to Android system
In terminal, methods described includes:
When detect jump to second page from first page when, obtain the first page and jump to the second page
Redirect mode;
When detect be back to the first page from the second page when, redirect mode to described according to what is got
Predetermined registration operation corresponding to first page execution.
Optionally, the mode that redirects includes:Redirection redirects mode and triggering redirects mode.
Optionally, the mode that redirects for obtaining the first page and jumping to the second page, including:
By rewriteeing the ShouldOverrideUrlLoading in WebView, WebView.HitTestResult is obtained
Value;
Whether the value for judging WebView.HitTestResult is 0;If so, then the mode that redirects redirects for redirection
Mode;If it is not, then the mode that redirects redirects mode for triggering.
Optionally, what the basis was got redirects mode to predetermined registration operation corresponding to first page execution, including:
If the mode that redirects redirects mode for redirection, the first page is closed;
If the mode that redirects redirects mode for triggering, refresh the first page.
Optionally, methods described also includes:
In WebView, the first page is carried by Activity A, and described the is carried by Activity B
Two pages.
Optionally, methods described also includes:
The Activity A of the first page are carried by calling StartActivityForResult to jump to carrying
The Activity B of the second page.
In addition, to achieve the above object, the application also proposes a kind of page jump managing device, applied to Android system
In mobile terminal, described device includes:
Acquisition module, for when detect jump to second page from first page when, obtain the first page and redirect
Mode is redirected to the second page;
Processing module, for when detect be back to the first page from the second page when, according to what is got
Mode is redirected to predetermined registration operation corresponding to first page execution.
Optionally, the mode that redirects includes:Redirection redirects mode and triggering redirects mode.
Optionally, the acquisition module, is specifically used for:By rewriteeing in WebView
ShouldOverrideUrlLoading, obtain WebView.HitTestResult value;
Whether the value for judging WebView.HitTestResult is 0;If so, then the mode that redirects redirects for redirection
Mode;If it is not, then the mode that redirects redirects mode for triggering.
Optionally, the processing module, is specifically used for:
If the mode that redirects redirects mode for redirection, the first page is closed;
If the mode that redirects redirects mode for triggering, refresh the first page.
The page jump management method and device that the application proposes, solve and go out in the mobile terminal using Android system
It is existing, enter caused by due to automatic refreshing that homepage is set when being back to homepage from the redirection page of homepage
The problem of endless loop.In addition, the application can be made a distinction in a manner of the redirecting of second page is jumped to first page, judge
Second page is to redirect that mode obtains by the triggering of click type or redirect what mode obtained by redirecting.
Brief description of the drawings
Fig. 1 is the flow chart of the page jump management method of first embodiment of the invention;
Fig. 2 is the flow chart of the page jump management method of second embodiment of the invention;
Fig. 3 is the composition structural representation of the page jump managing device of third embodiment of the invention.
Embodiment
Further to illustrate the present invention to reach the technological means and effect that predetermined purpose is taken, below in conjunction with accompanying drawing
And preferred embodiment, the present invention is described in detail as after.
First embodiment of the invention, a kind of page jump management method, applied in the mobile terminal of Android system, such as scheme
Shown in 1, methods described specifically includes following steps:
Step S101:When detect jump to second page from first page when, obtain the first page and jump to institute
That states second page redirects mode.
Specifically, the mode that redirects includes:Redirection redirects mode and triggering redirects mode.
Redirect is exactly that a various network requests again fixed direction are gone into other positions by various methods.In this implementation
In example, redirection refers to that webpage redirects, i.e., can be automatically from the first net when opening the first webpage, and meeting trigger condition
Page jumps to the second webpage, and the second webpage is the redirection webpage of the first webpage.
It is user by clicking on the button with the second web page interlinkage on the first webpage that triggering, which redirects mode, or by defeated
Enter the network address of the second webpage, so as to jump to the mode on the second webpage.
Further, the mode that redirects for obtaining the first page and jumping to the second page, including:
By rewriteeing the ShouldOverrideUrlLoading methods of WebViewClient in WebView, obtain
WebView.HitTestResult value;
Whether the value for judging WebView.HitTestResult is 0;If so, then the mode that redirects redirects for redirection
Mode;If it is not, then the mode that redirects redirects mode for triggering.
In actual applications, jumping to second page from first page includes two kinds of situations;The first situation is from first
For page reorientation to second page, second of situation is that user enters second by clicking on the button of the link with second page
In the page.In order to distinguish above-mentioned two situations, sentenced in the present embodiment by obtaining WebView.HitTestResult value
Disconnected second page is entered by redirecting past or normal click.Enter if second page is normal click,
WebView.HitTestResult value is not 0;If second page is that redirection is past,
WebView.HitTestResult value is 0.
Step S102:When detect be back to the first page from the second page when, redirected according to what is got
Mode is to predetermined registration operation corresponding to first page execution.
Specifically, the basis get redirect mode to the first page perform corresponding to predetermined registration operation, including:
If the mode that redirects redirects mode for redirection, the first page is closed;
If the mode that redirects redirects mode for triggering, refresh the first page.
When detect be back to first page from second page when, mode is redirected based on what is got before, to described
One page performs refresh page or closes the operation of the page.If second page is obtained by redirecting, in order to avoid
Due to the automatic refresh operation that is set in first page and caused by jump to second page again, hence into asking for endless loop
Topic, when being back to first page from second page, close first page.If second page is entered by common clicking operation
Go, when being back to first page from second page, refresh first page.
The present embodiment obtains the jump that first page jumps to second page when first page jumps to second page
Turn mode, when being back to first page from second page, brush is performed to first page according to the mode that redirects got before
New or shutoff operation.
Second embodiment of the invention, a kind of page jump management method, applied in the mobile terminal of Android system, such as scheme
Shown in 2, methods described specifically includes following steps:
Step S201:In WebView, first page is carried by Activity A, and carry by Activity B
Second page.
Step S202:When jumping to second page from first page, the Activity A for carrying the first page lead to
Cross and call StartActivityForResult to jump to the Activity B for carrying the second page.
Specifically, Activity A by call StartActivityForResult open Activity B, and
Operation processing is carried out in Activity B, after Activity B call finish () or back, Activity B pass through tune
Activity A are returned to by result value is operated with setResult, Activity A pass through calling again
OnActivityResult receives the operation result value that Activity B are fed back to.
Further, first page, which jumps to second page, includes following two modes:Redirection redirects mode and triggering
Redirect mode.
Redirect is exactly that a various network requests again fixed direction are gone into other positions by various methods.In this implementation
In example, redirection refers to that webpage redirects, i.e., can be automatically from the first net when opening the first webpage, and meeting trigger condition
Page jumps to the second webpage, and the second webpage is the redirection webpage of the first webpage.
It is user by clicking on the button with the second web page interlinkage on the first webpage that triggering, which redirects mode, or by defeated
Enter the network address of the second webpage, so as to jump to the mode on the second webpage.
Step S203:By rewriteeing the ShouldOverrideUrlLoading in WebView, obtain
WebView.HitTestResult value, and store WebView.HitTestResult value.
In actual applications, jumping to second page from first page includes two kinds of situations;The first situation is from first
For page reorientation to second page, second of situation is that user enters second by clicking on the button of the link with second page
In the page.In order to distinguish above-mentioned two situations, sentenced in the present embodiment by obtaining WebView.HitTestResult value
Disconnected second page is entered by redirecting past or normal click.Enter if second page is normal click,
WebView.HitTestResult value is not 0;If second page is that redirection is past,
WebView.HitTestResult value is 0.
Step S204:When detect be back to the first page from the second page when, obtain storage
WebView.HitTestResult value.
Step S205:Whether the value for judging WebView.HitTestResult is 0;If so, then perform step S206;If
It is no, then perform step S207.
Specifically, if WebView.HitTestResult value is 0, first page redirects mode by redirection and beaten
Open second page;
If WebView.HitTestResult value is not 0, first page redirects mode by triggering and opens second page
Face.
Step S206:Close the first page.
Specifically, when detect be back to first page from second page when, based on storage
WebView.HitTestResult value, the operation of response is performed to the first page.If
WebView.HitTestResult value is 0, i.e., second page is opened by the redirection operation of first page, in order to
Avoid the automatic refresh operation due to being set in first page and caused by jump to second page again, hence into endless loop
The problem of, when being back to first page from second page, close first page.
Step S207:Refresh the first page.
Specifically, specifically, when detect be back to first page from second page when, based on storage
WebView.HitTestResult value, the operation of response is performed to the first page.If
WebView.HitTestResult value is not 0, i.e. second page is that have second page by clicking in first page
The button of link is opened, and when being back to first page from second page, refreshes first page.
Third embodiment of the invention, a kind of page jump managing device, applied in the mobile terminal of Android system, such as scheme
Shown in 3, described device specifically includes consisting of part:
Acquisition module 301, for when detect jump to second page from first page when, obtain the first page and jump
Go to the second page redirects mode.
Specifically, the mode that redirects includes:Redirection redirects mode and triggering redirects mode.
Redirect is exactly that a various network requests again fixed direction are gone into other positions by various methods.In this implementation
In example, redirection refers to that webpage redirects, i.e., can be automatically from the first net when opening the first webpage, and meeting trigger condition
Page jumps to the second webpage, and the second webpage is the redirection webpage of the first webpage.
It is user by clicking on the button with the second web page interlinkage on the first webpage that triggering, which redirects mode, or by defeated
Enter the network address of the second webpage, so as to jump to the mode on the second webpage.
Further, acquisition module 301, it is specifically used for::
By rewriteeing the ShouldOverrideUrlLoading methods of WebViewClient in WebView, obtain
WebView.HitTestResult value;
Whether the value for judging WebView.HitTestResult is 0;If so, then the mode that redirects redirects for redirection
Mode;If it is not, then the mode that redirects redirects mode for triggering.
In actual applications, jumping to second page from first page includes two kinds of situations;The first situation is from first
For page reorientation to second page, second of situation is that user enters second by clicking on the button of the link with second page
In the page.In order to distinguish above-mentioned two situations, sentenced in the present embodiment by obtaining WebView.HitTestResult value
Disconnected second page is entered by redirecting past or normal click.Enter if second page is normal click,
WebView.HitTestResult value is not 0;If second page is that redirection is past,
WebView.HitTestResult value is 0.
Processing module 302, for when detect be back to the first page from the second page when, according to getting
Redirect mode to the first page perform corresponding to predetermined registration operation.
Specifically, processing module 302, is specifically used for:
If the mode that redirects redirects mode for redirection, the first page is closed;
If the mode that redirects redirects mode for triggering, refresh the first page.
When detect be back to first page from second page when, mode is redirected based on what is got before, to described
One page performs refresh page or closes the operation of the page.If second page is obtained by redirecting, in order to avoid
Due to the automatic refresh operation that is set in first page and caused by jump to second page again, hence into asking for endless loop
Topic, when being back to first page from second page, close first page.If second page is entered by common clicking operation
Go, when being back to first page from second page, refresh first page.
The present embodiment obtains the jump that first page jumps to second page when first page jumps to second page
Turn mode, when being back to first page from second page, brush is performed to first page according to the mode that redirects got before
New or shutoff operation.
The page jump management method and device introduced in the embodiment of the present invention, solve in the movement using Android system
Occur in terminal, when being back to homepage from the redirection page of homepage caused by due to automatic refreshing that homepage is set
The problem of entering endless loop during face.In addition, the application can be carried out in a manner of the redirecting of second page is jumped to first page
Distinguish, it is to redirect that mode obtains by the triggering of click type or redirect mode by redirection and obtain to judge second page
's.
By the explanation of embodiment, should can to the present invention for reach technological means that predetermined purpose is taken and
Effect is able to more go deep into and specific understanding, but appended diagram is only to provide reference and purposes of discussion, not for this
Invention is any limitation as.
Claims (10)
- A kind of 1. page jump management method, it is characterised in that applied in the mobile terminal of Android system, methods described bag Include:When detect jump to second page from first page when, obtain the jump that the first page jumps to the second page Turn mode;When detect be back to the first page from the second page when, redirect mode to described first according to what is got Predetermined registration operation corresponding to page execution.
- 2. page jump management method according to claim 1, it is characterised in that the mode that redirects includes:Redirect Redirect mode and triggering redirects mode.
- 3. page jump management method according to claim 2, it is characterised in that the acquisition first page redirects To the mode that redirects of the second page, including:By rewriteeing the ShouldOverrideUrlLoading in WebView, obtain WebView.HitTestResult's Value;Whether the value for judging WebView.HitTestResult is 0;If so, then the mode that redirects redirects mode for redirection; If it is not, then the mode that redirects redirects mode for triggering.
- 4. page jump management method according to claim 2, it is characterised in that what the basis was got redirects mode Predetermined registration operation corresponding to being performed to the first page, including:If the mode that redirects redirects mode for redirection, the first page is closed;If the mode that redirects redirects mode for triggering, refresh the first page.
- 5. page jump management method according to claim 1, it is characterised in that methods described also includes:In WebView, the first page is carried by Activity A, and the second page is carried by Activity B Face.
- 6. page jump management method according to claim 5, it is characterised in that methods described also includes:The Activity A of the first page are carried by calling StartActivityForResult to jump to described in carrying The Activity B of second page.
- A kind of 7. page jump managing device, it is characterised in that applied in the mobile terminal of Android system, described device bag Include:Acquisition module, for when detect jump to second page from first page when, obtain the first page and jump to institute That states second page redirects mode;Processing module, for when detect be back to the first page from the second page when, redirected according to what is got Mode is to predetermined registration operation corresponding to first page execution.
- 8. page jump managing device according to claim 7, it is characterised in that the mode that redirects includes:Redirect Redirect mode and triggering redirects mode.
- 9. page jump managing device according to claim 8, it is characterised in that the acquisition module, be specifically used for:By rewriteeing the ShouldOverrideUrlLoading in WebView, obtain WebView.HitTestResult's Value;Whether the value for judging WebView.HitTestResult is 0;If so, then the mode that redirects redirects mode for redirection; If it is not, then the mode that redirects redirects mode for triggering.
- 10. page jump managing device according to claim 8, it is characterised in that the processing module, be specifically used for:If the mode that redirects redirects mode for redirection, the first page is closed;If the mode that redirects redirects mode for triggering, refresh the first page.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710507925.9A CN107506178B (en) | 2017-06-28 | 2017-06-28 | Page jump management method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710507925.9A CN107506178B (en) | 2017-06-28 | 2017-06-28 | Page jump management method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107506178A true CN107506178A (en) | 2017-12-22 |
CN107506178B CN107506178B (en) | 2021-09-14 |
Family
ID=60679411
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710507925.9A Active CN107506178B (en) | 2017-06-28 | 2017-06-28 | Page jump management method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107506178B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108268622A (en) * | 2018-01-08 | 2018-07-10 | 金行家(深圳)文化传播有限公司 | The method, apparatus and computer readable storage medium of back page |
CN109857386A (en) * | 2018-12-30 | 2019-06-07 | 贝壳技术有限公司 | A kind of method for page jump and device |
CN110688592A (en) * | 2018-07-06 | 2020-01-14 | 武汉斗鱼网络科技有限公司 | External link skipping method, storage medium, electronic device and system |
WO2020113929A1 (en) * | 2018-12-07 | 2020-06-11 | 珠海格力电器股份有限公司 | Page skip control method and device |
CN112685118A (en) * | 2020-12-29 | 2021-04-20 | 平安普惠企业管理有限公司 | Page returning method and device, storage medium and computer equipment |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103678364A (en) * | 2012-09-13 | 2014-03-26 | 阿里巴巴集团控股有限公司 | Dynamic detection method and device for URL redirection endless loop |
-
2017
- 2017-06-28 CN CN201710507925.9A patent/CN107506178B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103678364A (en) * | 2012-09-13 | 2014-03-26 | 阿里巴巴集团控股有限公司 | Dynamic detection method and device for URL redirection endless loop |
Non-Patent Citations (1)
Title |
---|
时之沙: "Android WebView 因重定向无法正常goBack()解决方案", 《HTTPS://BLOG.CSDN.NET/T12X3456/ARTICLE/DETAILS/39134961》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108268622A (en) * | 2018-01-08 | 2018-07-10 | 金行家(深圳)文化传播有限公司 | The method, apparatus and computer readable storage medium of back page |
CN110688592A (en) * | 2018-07-06 | 2020-01-14 | 武汉斗鱼网络科技有限公司 | External link skipping method, storage medium, electronic device and system |
WO2020113929A1 (en) * | 2018-12-07 | 2020-06-11 | 珠海格力电器股份有限公司 | Page skip control method and device |
CN109857386A (en) * | 2018-12-30 | 2019-06-07 | 贝壳技术有限公司 | A kind of method for page jump and device |
CN109857386B (en) * | 2018-12-30 | 2022-06-21 | 贝壳技术有限公司 | Page skipping method and device |
CN112685118A (en) * | 2020-12-29 | 2021-04-20 | 平安普惠企业管理有限公司 | Page returning method and device, storage medium and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN107506178B (en) | 2021-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107506178A (en) | A kind of page jump management method and device | |
CN103605924B (en) | A kind of method and device preventing rogue program attacking network from paying the page | |
Mauro et al. | A poverty trap of crime and unemployment | |
CN103634301B (en) | The method of the private data of user's storage in client and access server thereof | |
CN106503134A (en) | Browser jumps to the method for data synchronization and device of application program | |
CN109190026B (en) | Client recommendation method and computer-readable storage medium | |
Priyambodo et al. | M-Commerce in Indonesia: Problems and Prospects | |
CN107168960A (en) | A kind of business performs method and device | |
US20140358631A1 (en) | Method and apparatus for generating frequently asked questions | |
CN109669718A (en) | System permission configuration method, device, equipment and storage medium | |
CN108196829A (en) | A kind of artificial intelligence mobile phone accounting system for analyzing account and method | |
CN111222861B (en) | Recharging method and device after arrearage and computing equipment | |
US20190377766A1 (en) | Web access enhancement | |
CN106487793A (en) | application installation method and device | |
CN108268578A (en) | The method and system of Web page picture loading | |
CN102946391B (en) | The method of prompting malice network address and a kind of browser in a kind of browser | |
CN110298650A (en) | Interface calls charging method, device, equipment and storage medium | |
CN103336693B (en) | The creation method of refer chain, device and security detection equipment | |
CN103544288A (en) | Browser webpage loading control method and device | |
CN104468635B (en) | The user right step-up authentication method and system of the network platform | |
CN109325192A (en) | A kind of method and apparatus of the anti-shielding of advertisement | |
CN106022121A (en) | Data obtaining method and device | |
CN108090156A (en) | A kind of method that book keeping operation artificial intelligence accounting system can be cooperateed with based on HTML5 establishments | |
CN107491480A (en) | A kind of search result display processing method and device | |
CN106330811A (en) | Domain name credibility determination method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |